diff --git a/PKHeX.Core/Saves/SAV7.cs b/PKHeX.Core/Saves/SAV7.cs index 69d604f04..3a3c4a6bc 100644 --- a/PKHeX.Core/Saves/SAV7.cs +++ b/PKHeX.Core/Saves/SAV7.cs @@ -423,6 +423,16 @@ public string NexUniqueID .ToArray().CopyTo(Data, TrainerCard + 0x18); } } + public byte[] FestaID // 12byte + { + get => Data.Skip(TrainerCard + 0x28).Take(4).Concat(Data.Skip(TrainerCard + 0x18).Take(8)).ToArray(); + set + { + if ((value?.Length ?? 0) != 12) return; + Array.Copy(value, 0, Data, TrainerCard + 0x28, 4); + Array.Copy(value, 4, Data, TrainerCard + 0x18, 8); + } + } public override int SubRegion { get => Data[TrainerCard + 0x2E]; @@ -609,11 +619,11 @@ public int DaysFromRefreshed } public uint UsedFestaCoins { - get => BitConverter.ToUInt32(Data, 0x69C98); + get => BitConverter.ToUInt32(Data, Record + (38 << 2)); //Record[038] set { if (value > 9999999) value = 9999999; - BitConverter.GetBytes(value).CopyTo(Data, 0x69C98); + BitConverter.GetBytes(value).CopyTo(Data, Record + (38 << 2)); } } public uint FestaCoins @@ -646,6 +656,41 @@ public string FestivalPlazaName Encoding.Unicode.GetBytes(value.PadRight(value.Length + 1, '\0')).CopyTo(Data, JoinFestaData + 0x510); } } + public ushort FestaRank { get => BitConverter.ToUInt16(Data, JoinFestaData + 0x53A); set => BitConverter.GetBytes(value).CopyTo(Data, JoinFestaData + 0x53A); } + public ushort getFestaMessage(int index) => Data[JoinFestaData + (index << 1)]; + public void setFestaMessage(int index, ushort value) => BitConverter.GetBytes(value).CopyTo(Data, JoinFestaData + (index << 1)); + public bool getFestaPhraseUnlocked(int index) => Data[JoinFestaData + 0x2A50 + index] != 0; //index: 0 to 105:commonPhrases, 106:Lv100! + public void setFestaPhraseUnlocked(int index, bool value) + { + if (getFestaPhraseUnlocked(index) != value) Data[JoinFestaData + 0x2A50 + index] = (byte)(value ? 1 : 0); + } + public byte getFestPrizeReceived(int index) => Data[JoinFestaData + 0x53C + index]; + public void setFestaPrizeReceived(int index, byte value) => Data[JoinFestaData + 0x53C + index] = value; + private int FestaYear { get => BitConverter.ToInt32(Data, JoinFestaData + 0x2F0); set => BitConverter.GetBytes(value).CopyTo(Data, JoinFestaData + 0x2F0); } + private int FestaMonth { get => BitConverter.ToInt32(Data, JoinFestaData + 0x2F4); set => BitConverter.GetBytes(value).CopyTo(Data, JoinFestaData + 0x2F4); } + private int FestaDay { get => BitConverter.ToInt32(Data, JoinFestaData + 0x2F8); set => BitConverter.GetBytes(value).CopyTo(Data, JoinFestaData + 0x2F8); } + private int FestaHour { get => BitConverter.ToInt32(Data, JoinFestaData + 0x300); set => BitConverter.GetBytes(value).CopyTo(Data, JoinFestaData + 0x300); } + private int FestaMinute { get => BitConverter.ToInt32(Data, JoinFestaData + 0x304); set => BitConverter.GetBytes(value).CopyTo(Data, JoinFestaData + 0x304); } + private int FestaSecond { get => BitConverter.ToInt32(Data, JoinFestaData + 0x308); set => BitConverter.GetBytes(value).CopyTo(Data, JoinFestaData + 0x308); } + public DateTime? FestaDate + { + get => FestaYear >= 0 && FestaMonth > 0 && FestaDay > 0 && FestaHour >= 0 && FestaMinute >= 0 && FestaSecond >= 0 && Util.IsDateValid(FestaYear, FestaMonth, FestaDay) + ? new DateTime(FestaYear, FestaMonth, FestaDay, FestaHour, FestaMinute, FestaSecond) + : (DateTime?)null; + set + { + if (value.HasValue) + { + DateTime dt = value.Value; + FestaYear = dt.Year; + FestaMonth = dt.Month; + FestaDay = dt.Day; + FestaHour = dt.Hour; + FestaMinute = dt.Minute; + FestaSecond = dt.Second; + } + } + } public sealed class FashionItem { public bool IsOwned; diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs index 918005357..5be2c6ccb 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.Designer.cs @@ -111,6 +111,7 @@ private void InitializeComponent() this.B_OpenRTCEditor = new System.Windows.Forms.Button(); this.B_OpenUGSEditor = new System.Windows.Forms.Button(); this.B_Roamer = new System.Windows.Forms.Button(); + this.B_FestivalPlaza = new System.Windows.Forms.Button(); this.tabBoxMulti.SuspendLayout(); this.Tab_Box.SuspendLayout(); this.Tab_PartyBattle.SuspendLayout(); @@ -784,6 +785,7 @@ private void InitializeComponent() this.FLP_SAVtools.Controls.Add(this.B_OpenRTCEditor); this.FLP_SAVtools.Controls.Add(this.B_OpenUGSEditor); this.FLP_SAVtools.Controls.Add(this.B_Roamer); + this.FLP_SAVtools.Controls.Add(this.B_FestivalPlaza); this.FLP_SAVtools.Location = new System.Drawing.Point(6, 10); this.FLP_SAVtools.Name = "FLP_SAVtools"; this.FLP_SAVtools.Size = new System.Drawing.Size(297, 88); @@ -1032,6 +1034,16 @@ private void InitializeComponent() this.B_Roamer.UseVisualStyleBackColor = true; this.B_Roamer.Click += new System.EventHandler(this.B_Roamer_Click); // + // B_FestivalPlaza + // + this.B_FestivalPlaza.Location = new System.Drawing.Point(3, 235); + this.B_FestivalPlaza.Name = "B_FestivalPlaza"; + this.B_FestivalPlaza.Size = new System.Drawing.Size(87, 23); + this.B_FestivalPlaza.TabIndex = 31; + this.B_FestivalPlaza.Text = "Festival Plaza"; + this.B_FestivalPlaza.UseVisualStyleBackColor = true; + this.B_FestivalPlaza.Click += new System.EventHandler(this.B_FestivalPlaza_Click); + // // SAVEditor // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; @@ -1168,5 +1180,6 @@ private void InitializeComponent() public BoxEditor Box; private System.Windows.Forms.Button B_OpenUGSEditor; private System.Windows.Forms.Button B_Roamer; + private System.Windows.Forms.Button B_FestivalPlaza; } } diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs index 866e18a33..b1853f6ef 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs @@ -1009,6 +1009,7 @@ private void ToggleViewSubEditors(SaveFile sav) B_OpenHoneyTreeEditor.Enabled = sav.DP || sav.Pt; B_OpenRTCEditor.Enabled = sav.RS || sav.E || sav.Generation == 2; B_OpenUGSEditor.Enabled = sav.DP || sav.Pt; + B_FestivalPlaza.Enabled = sav.Generation == 7; } GB_SAVtools.Visible = sav.Exportable && FLP_SAVtools.Controls.Cast().Any(c => c.Enabled); foreach (Control c in FLP_SAVtools.Controls.Cast()) @@ -1140,5 +1141,10 @@ private void B_OpenUGSEditor_Click(object sender, EventArgs e) new SAV_Underground(SAV).ShowDialog(); break; } } + private void B_FestivalPlaza_Click(object sender, EventArgs e) + { + if (SAV.Generation == 7) + new SAV_FestivalPlaza(SAV).ShowDialog(); + } } } diff --git a/PKHeX.WinForms/PKHeX.WinForms.csproj b/PKHeX.WinForms/PKHeX.WinForms.csproj index f63a48005..272cceb57 100644 --- a/PKHeX.WinForms/PKHeX.WinForms.csproj +++ b/PKHeX.WinForms/PKHeX.WinForms.csproj @@ -432,6 +432,12 @@ SAV_Trainer.cs + + Form + + + SAV_FestivalPlaza.cs + Form @@ -676,6 +682,9 @@ SAV_Trainer.cs + + SAV_FestivalPlaza.cs + SAV_HallOfFame7.cs diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_FestivalPlaza.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_FestivalPlaza.Designer.cs new file mode 100644 index 000000000..95208ae9d --- /dev/null +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_FestivalPlaza.Designer.cs @@ -0,0 +1,725 @@ +namespace PKHeX.WinForms +{ + partial class SAV_FestivalPlaza + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SAV_FestivalPlaza)); + this.NUD_FC_Current = new System.Windows.Forms.NumericUpDown(); + this.L_FC_Current = new System.Windows.Forms.Label(); + this.GB_FC = new System.Windows.Forms.GroupBox(); + this.L_FC_CollectedV = new System.Windows.Forms.Label(); + this.L_FC_CollectedL = new System.Windows.Forms.Label(); + this.NUD_FC_Used = new System.Windows.Forms.NumericUpDown(); + this.L_FC_Used = new System.Windows.Forms.Label(); + this.B_Save = new System.Windows.Forms.Button(); + this.B_Cancel = new System.Windows.Forms.Button(); + this.GB_Phrase = new System.Windows.Forms.GroupBox(); + this.CLB_Phrases = new System.Windows.Forms.CheckedListBox(); + this.B_AllPhrases = new System.Windows.Forms.Button(); + this.TB_OTName = new System.Windows.Forms.TextBox(); + this.GB_Facility = new System.Windows.Forms.GroupBox(); + this.L_FacilityColorV = new System.Windows.Forms.Label(); + this.L_VisitorMisc = new System.Windows.Forms.Label(); + this.TB_FacilityID = new System.Windows.Forms.TextBox(); + this.CB_FacilityID = new System.Windows.Forms.ComboBox(); + this.GB_FacilityMessage = new System.Windows.Forms.GroupBox(); + this.NUD_FacilityMessage = new System.Windows.Forms.NumericUpDown(); + this.CB_FacilityMessage = new System.Windows.Forms.ComboBox(); + this.Label_OTGender = new System.Windows.Forms.Label(); + this.CHK_FacilityIntroduced = new System.Windows.Forms.CheckBox(); + this.L_FacilityNPC = new System.Windows.Forms.Label(); + this.NUD_FacilityColor = new System.Windows.Forms.NumericUpDown(); + this.L_FacilityColor = new System.Windows.Forms.Label(); + this.L_FacilityType = new System.Windows.Forms.Label(); + this.L_FacilityIndex = new System.Windows.Forms.Label(); + this.CB_FacilityNPC = new System.Windows.Forms.ComboBox(); + this.CB_FacilityType = new System.Windows.Forms.ComboBox(); + this.NUD_FacilityIndex = new System.Windows.Forms.NumericUpDown(); + this.CAL_FestaStartDate = new System.Windows.Forms.DateTimePicker(); + this.CAL_FestaStartTime = new System.Windows.Forms.DateTimePicker(); + this.GB_FestaStartTime = new System.Windows.Forms.GroupBox(); + this.GB_Reward = new System.Windows.Forms.GroupBox(); + this.B_AllReadyReward = new System.Windows.Forms.Button(); + this.CLB_Reward = new System.Windows.Forms.CheckedListBox(); + this.B_AllReceiveReward = new System.Windows.Forms.Button(); + this.NUD_Rank = new System.Windows.Forms.NumericUpDown(); + this.L_Rank = new System.Windows.Forms.Label(); + this.GB_MyMessage = new System.Windows.Forms.GroupBox(); + this.NUD_MyMessage = new System.Windows.Forms.NumericUpDown(); + this.CB_MyMessage = new System.Windows.Forms.ComboBox(); + this.L_Note = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_FC_Current)).BeginInit(); + this.GB_FC.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_FC_Used)).BeginInit(); + this.GB_Phrase.SuspendLayout(); + this.GB_Facility.SuspendLayout(); + this.GB_FacilityMessage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityMessage)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityColor)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityIndex)).BeginInit(); + this.GB_FestaStartTime.SuspendLayout(); + this.GB_Reward.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_Rank)).BeginInit(); + this.GB_MyMessage.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_MyMessage)).BeginInit(); + this.SuspendLayout(); + // + // NUD_FC_Current + // + this.NUD_FC_Current.Location = new System.Drawing.Point(82, 18); + this.NUD_FC_Current.Maximum = new decimal(new int[] { + 9999999, + 0, + 0, + 0}); + this.NUD_FC_Current.Name = "NUD_FC_Current"; + this.NUD_FC_Current.Size = new System.Drawing.Size(66, 19); + this.NUD_FC_Current.TabIndex = 1; + this.NUD_FC_Current.Value = new decimal(new int[] { + 9999999, + 0, + 0, + 0}); + this.NUD_FC_Current.ValueChanged += new System.EventHandler(this.NUD_FC_ValueChanged); + // + // L_FC_Current + // + this.L_FC_Current.Location = new System.Drawing.Point(6, 17); + this.L_FC_Current.Name = "L_FC_Current"; + this.L_FC_Current.Size = new System.Drawing.Size(70, 18); + this.L_FC_Current.TabIndex = 2; + this.L_FC_Current.Text = "Current:"; + this.L_FC_Current.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // GB_FC + // + this.GB_FC.Controls.Add(this.L_FC_CollectedV); + this.GB_FC.Controls.Add(this.L_FC_CollectedL); + this.GB_FC.Controls.Add(this.NUD_FC_Used); + this.GB_FC.Controls.Add(this.L_FC_Used); + this.GB_FC.Controls.Add(this.NUD_FC_Current); + this.GB_FC.Controls.Add(this.L_FC_Current); + this.GB_FC.Location = new System.Drawing.Point(12, 12); + this.GB_FC.Name = "GB_FC"; + this.GB_FC.Size = new System.Drawing.Size(157, 96); + this.GB_FC.TabIndex = 2; + this.GB_FC.TabStop = false; + this.GB_FC.Text = "Festa Coins"; + // + // L_FC_CollectedV + // + this.L_FC_CollectedV.Location = new System.Drawing.Point(82, 67); + this.L_FC_CollectedV.Name = "L_FC_CollectedV"; + this.L_FC_CollectedV.Size = new System.Drawing.Size(62, 18); + this.L_FC_CollectedV.TabIndex = 6; + this.L_FC_CollectedV.Text = "9999999"; + this.L_FC_CollectedV.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // L_FC_CollectedL + // + this.L_FC_CollectedL.Location = new System.Drawing.Point(6, 67); + this.L_FC_CollectedL.Name = "L_FC_CollectedL"; + this.L_FC_CollectedL.Size = new System.Drawing.Size(70, 18); + this.L_FC_CollectedL.TabIndex = 5; + this.L_FC_CollectedL.Text = "Collected:"; + this.L_FC_CollectedL.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // NUD_FC_Used + // + this.NUD_FC_Used.Location = new System.Drawing.Point(82, 43); + this.NUD_FC_Used.Maximum = new decimal(new int[] { + 9999999, + 0, + 0, + 0}); + this.NUD_FC_Used.Name = "NUD_FC_Used"; + this.NUD_FC_Used.Size = new System.Drawing.Size(66, 19); + this.NUD_FC_Used.TabIndex = 3; + this.NUD_FC_Used.Value = new decimal(new int[] { + 9999999, + 0, + 0, + 0}); + this.NUD_FC_Used.ValueChanged += new System.EventHandler(this.NUD_FC_ValueChanged); + // + // L_FC_Used + // + this.L_FC_Used.Location = new System.Drawing.Point(6, 42); + this.L_FC_Used.Name = "L_FC_Used"; + this.L_FC_Used.Size = new System.Drawing.Size(70, 18); + this.L_FC_Used.TabIndex = 4; + this.L_FC_Used.Text = "Used:"; + this.L_FC_Used.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // B_Save + // + this.B_Save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.B_Save.Location = new System.Drawing.Point(398, 446); + this.B_Save.Name = "B_Save"; + this.B_Save.Size = new System.Drawing.Size(75, 21); + this.B_Save.TabIndex = 1; + this.B_Save.Text = "Save"; + this.B_Save.UseVisualStyleBackColor = true; + this.B_Save.Click += new System.EventHandler(this.B_Save_Click); + // + // B_Cancel + // + this.B_Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.B_Cancel.Location = new System.Drawing.Point(317, 446); + this.B_Cancel.Name = "B_Cancel"; + this.B_Cancel.Size = new System.Drawing.Size(75, 21); + this.B_Cancel.TabIndex = 0; + this.B_Cancel.Text = "Cancel"; + this.B_Cancel.UseVisualStyleBackColor = true; + this.B_Cancel.Click += new System.EventHandler(this.B_Cancel_Click); + // + // GB_Phrase + // + this.GB_Phrase.Controls.Add(this.CLB_Phrases); + this.GB_Phrase.Controls.Add(this.B_AllPhrases); + this.GB_Phrase.Location = new System.Drawing.Point(12, 117); + this.GB_Phrase.Name = "GB_Phrase"; + this.GB_Phrase.Size = new System.Drawing.Size(246, 146); + this.GB_Phrase.TabIndex = 3; + this.GB_Phrase.TabStop = false; + this.GB_Phrase.Text = "Common Phrases+"; + // + // CLB_Phrases + // + this.CLB_Phrases.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.CLB_Phrases.CheckOnClick = true; + this.CLB_Phrases.FormattingEnabled = true; + this.CLB_Phrases.IntegralHeight = false; + this.CLB_Phrases.Location = new System.Drawing.Point(9, 53); + this.CLB_Phrases.Name = "CLB_Phrases"; + this.CLB_Phrases.Size = new System.Drawing.Size(228, 84); + this.CLB_Phrases.TabIndex = 1; + // + // B_AllPhrases + // + this.B_AllPhrases.Location = new System.Drawing.Point(9, 21); + this.B_AllPhrases.Name = "B_AllPhrases"; + this.B_AllPhrases.Size = new System.Drawing.Size(75, 23); + this.B_AllPhrases.TabIndex = 0; + this.B_AllPhrases.Text = "Check All"; + this.B_AllPhrases.UseVisualStyleBackColor = true; + this.B_AllPhrases.Click += new System.EventHandler(this.B_AllPhrases_Click); + // + // TB_OTName + // + this.TB_OTName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.TB_OTName.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.TB_OTName.Location = new System.Drawing.Point(327, 21); + this.TB_OTName.MaxLength = 12; + this.TB_OTName.Name = "TB_OTName"; + this.TB_OTName.Size = new System.Drawing.Size(93, 20); + this.TB_OTName.TabIndex = 4; + this.TB_OTName.Text = "WWWWWWWWWWWW"; + this.TB_OTName.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.TB_OTName.TextChanged += new System.EventHandler(this.TB_OTName_TextChanged); + this.TB_OTName.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TB_OTName_MouseDown); + // + // GB_Facility + // + this.GB_Facility.Controls.Add(this.L_FacilityColorV); + this.GB_Facility.Controls.Add(this.L_VisitorMisc); + this.GB_Facility.Controls.Add(this.TB_FacilityID); + this.GB_Facility.Controls.Add(this.CB_FacilityID); + this.GB_Facility.Controls.Add(this.GB_FacilityMessage); + this.GB_Facility.Controls.Add(this.Label_OTGender); + this.GB_Facility.Controls.Add(this.CHK_FacilityIntroduced); + this.GB_Facility.Controls.Add(this.L_FacilityNPC); + this.GB_Facility.Controls.Add(this.NUD_FacilityColor); + this.GB_Facility.Controls.Add(this.L_FacilityColor); + this.GB_Facility.Controls.Add(this.L_FacilityType); + this.GB_Facility.Controls.Add(this.L_FacilityIndex); + this.GB_Facility.Controls.Add(this.CB_FacilityNPC); + this.GB_Facility.Controls.Add(this.CB_FacilityType); + this.GB_Facility.Controls.Add(this.NUD_FacilityIndex); + this.GB_Facility.Controls.Add(this.TB_OTName); + this.GB_Facility.Location = new System.Drawing.Point(12, 269); + this.GB_Facility.Name = "GB_Facility"; + this.GB_Facility.Size = new System.Drawing.Size(455, 165); + this.GB_Facility.TabIndex = 5; + this.GB_Facility.TabStop = false; + this.GB_Facility.Text = "Facilities"; + // + // L_FacilityColorV + // + this.L_FacilityColorV.Location = new System.Drawing.Point(122, 77); + this.L_FacilityColorV.Name = "L_FacilityColorV"; + this.L_FacilityColorV.Size = new System.Drawing.Size(100, 18); + this.L_FacilityColorV.TabIndex = 60; + this.L_FacilityColorV.Text = "colorvalue"; + this.L_FacilityColorV.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // L_VisitorMisc + // + this.L_VisitorMisc.Location = new System.Drawing.Point(282, 108); + this.L_VisitorMisc.Name = "L_VisitorMisc"; + this.L_VisitorMisc.Size = new System.Drawing.Size(82, 18); + this.L_VisitorMisc.TabIndex = 59; + this.L_VisitorMisc.Text = "visitor misc:"; + this.L_VisitorMisc.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // TB_FacilityID + // + this.TB_FacilityID.Location = new System.Drawing.Point(169, 137); + this.TB_FacilityID.MaxLength = 32; + this.TB_FacilityID.Name = "TB_FacilityID"; + this.TB_FacilityID.Size = new System.Drawing.Size(277, 19); + this.TB_FacilityID.TabIndex = 0; + this.TB_FacilityID.Text = "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"; + this.TB_FacilityID.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.TB_FacilityID.TextChanged += new System.EventHandler(this.TB_FacilityID_TextChanged); + // + // CB_FacilityID + // + this.CB_FacilityID.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_FacilityID.DropDownWidth = 76; + this.CB_FacilityID.FormattingEnabled = true; + this.CB_FacilityID.Location = new System.Drawing.Point(370, 108); + this.CB_FacilityID.Name = "CB_FacilityID"; + this.CB_FacilityID.Size = new System.Drawing.Size(76, 20); + this.CB_FacilityID.TabIndex = 1; + this.CB_FacilityID.SelectedIndexChanged += new System.EventHandler(this.CB_FacilityID_SelectedIndexChanged); + // + // GB_FacilityMessage + // + this.GB_FacilityMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.GB_FacilityMessage.Controls.Add(this.NUD_FacilityMessage); + this.GB_FacilityMessage.Controls.Add(this.CB_FacilityMessage); + this.GB_FacilityMessage.Location = new System.Drawing.Point(292, 50); + this.GB_FacilityMessage.Name = "GB_FacilityMessage"; + this.GB_FacilityMessage.Size = new System.Drawing.Size(154, 49); + this.GB_FacilityMessage.TabIndex = 58; + this.GB_FacilityMessage.TabStop = false; + this.GB_FacilityMessage.Text = "visitor message"; + // + // NUD_FacilityMessage + // + this.NUD_FacilityMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.NUD_FacilityMessage.Location = new System.Drawing.Point(98, 21); + this.NUD_FacilityMessage.Maximum = new decimal(new int[] { + 9999, + 0, + 0, + 0}); + this.NUD_FacilityMessage.Name = "NUD_FacilityMessage"; + this.NUD_FacilityMessage.Size = new System.Drawing.Size(47, 19); + this.NUD_FacilityMessage.TabIndex = 1; + this.NUD_FacilityMessage.Value = new decimal(new int[] { + 9999, + 0, + 0, + 0}); + this.NUD_FacilityMessage.ValueChanged += new System.EventHandler(this.NUD_FacilityMessage_ValueChanged); + // + // CB_FacilityMessage + // + this.CB_FacilityMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.CB_FacilityMessage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_FacilityMessage.DropDownWidth = 102; + this.CB_FacilityMessage.FormattingEnabled = true; + this.CB_FacilityMessage.Location = new System.Drawing.Point(9, 21); + this.CB_FacilityMessage.Name = "CB_FacilityMessage"; + this.CB_FacilityMessage.Size = new System.Drawing.Size(83, 20); + this.CB_FacilityMessage.TabIndex = 0; + this.CB_FacilityMessage.SelectedIndexChanged += new System.EventHandler(this.CB_FacilityMessage_SelectedIndexChanged); + // + // Label_OTGender + // + this.Label_OTGender.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.Label_OTGender.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Label_OTGender.Location = new System.Drawing.Point(426, 21); + this.Label_OTGender.Name = "Label_OTGender"; + this.Label_OTGender.Size = new System.Drawing.Size(20, 20); + this.Label_OTGender.TabIndex = 57; + this.Label_OTGender.Text = "G"; + this.Label_OTGender.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.Label_OTGender.Click += new System.EventHandler(this.Label_OTGender_Click); + // + // CHK_FacilityIntroduced + // + this.CHK_FacilityIntroduced.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.CHK_FacilityIntroduced.Location = new System.Drawing.Point(193, 18); + this.CHK_FacilityIntroduced.Name = "CHK_FacilityIntroduced"; + this.CHK_FacilityIntroduced.Size = new System.Drawing.Size(128, 24); + this.CHK_FacilityIntroduced.TabIndex = 9; + this.CHK_FacilityIntroduced.Text = "visitor introduced"; + this.CHK_FacilityIntroduced.UseVisualStyleBackColor = true; + this.CHK_FacilityIntroduced.CheckedChanged += new System.EventHandler(this.CHK_FacilityIntroduced_CheckedChanged); + // + // L_FacilityNPC + // + this.L_FacilityNPC.Location = new System.Drawing.Point(27, 103); + this.L_FacilityNPC.Name = "L_FacilityNPC"; + this.L_FacilityNPC.Size = new System.Drawing.Size(45, 18); + this.L_FacilityNPC.TabIndex = 8; + this.L_FacilityNPC.Text = "NPC:"; + this.L_FacilityNPC.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // NUD_FacilityColor + // + this.NUD_FacilityColor.Location = new System.Drawing.Point(78, 78); + this.NUD_FacilityColor.Maximum = new decimal(new int[] { + 7, + 0, + 0, + 0}); + this.NUD_FacilityColor.Name = "NUD_FacilityColor"; + this.NUD_FacilityColor.Size = new System.Drawing.Size(35, 19); + this.NUD_FacilityColor.TabIndex = 7; + this.NUD_FacilityColor.Value = new decimal(new int[] { + 7, + 0, + 0, + 0}); + this.NUD_FacilityColor.ValueChanged += new System.EventHandler(this.NUD_FacilityColor_ValueChanged); + // + // L_FacilityColor + // + this.L_FacilityColor.Location = new System.Drawing.Point(25, 77); + this.L_FacilityColor.Name = "L_FacilityColor"; + this.L_FacilityColor.Size = new System.Drawing.Size(47, 18); + this.L_FacilityColor.TabIndex = 6; + this.L_FacilityColor.Text = "color:"; + this.L_FacilityColor.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // L_FacilityType + // + this.L_FacilityType.Location = new System.Drawing.Point(28, 52); + this.L_FacilityType.Name = "L_FacilityType"; + this.L_FacilityType.Size = new System.Drawing.Size(44, 18); + this.L_FacilityType.TabIndex = 5; + this.L_FacilityType.Text = "type:"; + this.L_FacilityType.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // L_FacilityIndex + // + this.L_FacilityIndex.Location = new System.Drawing.Point(9, 20); + this.L_FacilityIndex.Name = "L_FacilityIndex"; + this.L_FacilityIndex.Size = new System.Drawing.Size(49, 18); + this.L_FacilityIndex.TabIndex = 3; + this.L_FacilityIndex.Text = "index:"; + this.L_FacilityIndex.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // CB_FacilityNPC + // + this.CB_FacilityNPC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_FacilityNPC.DropDownWidth = 120; + this.CB_FacilityNPC.FormattingEnabled = true; + this.CB_FacilityNPC.Location = new System.Drawing.Point(78, 103); + this.CB_FacilityNPC.Name = "CB_FacilityNPC"; + this.CB_FacilityNPC.Size = new System.Drawing.Size(123, 20); + this.CB_FacilityNPC.TabIndex = 2; + // + // CB_FacilityType + // + this.CB_FacilityType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_FacilityType.DropDownWidth = 180; + this.CB_FacilityType.FormattingEnabled = true; + this.CB_FacilityType.Location = new System.Drawing.Point(78, 52); + this.CB_FacilityType.Name = "CB_FacilityType"; + this.CB_FacilityType.Size = new System.Drawing.Size(124, 20); + this.CB_FacilityType.TabIndex = 1; + this.CB_FacilityType.SelectedIndexChanged += new System.EventHandler(this.CB_FacilityType_SelectedIndexChanged); + // + // NUD_FacilityIndex + // + this.NUD_FacilityIndex.Location = new System.Drawing.Point(64, 21); + this.NUD_FacilityIndex.Maximum = new decimal(new int[] { + 6, + 0, + 0, + 0}); + this.NUD_FacilityIndex.Name = "NUD_FacilityIndex"; + this.NUD_FacilityIndex.Size = new System.Drawing.Size(35, 19); + this.NUD_FacilityIndex.TabIndex = 0; + this.NUD_FacilityIndex.Value = new decimal(new int[] { + 6, + 0, + 0, + 0}); + this.NUD_FacilityIndex.ValueChanged += new System.EventHandler(this.NUD_FacilityIndex_ValueChanged); + // + // CAL_FestaStartDate + // + this.CAL_FestaStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; + this.CAL_FestaStartDate.Location = new System.Drawing.Point(9, 21); + this.CAL_FestaStartDate.MaxDate = new System.DateTime(2050, 12, 31, 0, 0, 0, 0); + this.CAL_FestaStartDate.MinDate = new System.DateTime(1932, 1, 1, 0, 0, 0, 0); + this.CAL_FestaStartDate.Name = "CAL_FestaStartDate"; + this.CAL_FestaStartDate.Size = new System.Drawing.Size(99, 19); + this.CAL_FestaStartDate.TabIndex = 36; + this.CAL_FestaStartDate.Value = new System.DateTime(2000, 1, 1, 0, 0, 0, 0); + // + // CAL_FestaStartTime + // + this.CAL_FestaStartTime.CustomFormat = "HH:mm:ss"; + this.CAL_FestaStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; + this.CAL_FestaStartTime.Location = new System.Drawing.Point(9, 46); + this.CAL_FestaStartTime.MaxDate = new System.DateTime(2050, 12, 31, 0, 0, 0, 0); + this.CAL_FestaStartTime.MinDate = new System.DateTime(2000, 1, 1, 0, 0, 0, 0); + this.CAL_FestaStartTime.Name = "CAL_FestaStartTime"; + this.CAL_FestaStartTime.ShowUpDown = true; + this.CAL_FestaStartTime.Size = new System.Drawing.Size(73, 19); + this.CAL_FestaStartTime.TabIndex = 37; + this.CAL_FestaStartTime.Value = new System.DateTime(2001, 1, 1, 0, 0, 0, 0); + // + // GB_FestaStartTime + // + this.GB_FestaStartTime.Controls.Add(this.CAL_FestaStartDate); + this.GB_FestaStartTime.Controls.Add(this.CAL_FestaStartTime); + this.GB_FestaStartTime.Location = new System.Drawing.Point(178, 12); + this.GB_FestaStartTime.Name = "GB_FestaStartTime"; + this.GB_FestaStartTime.Size = new System.Drawing.Size(117, 74); + this.GB_FestaStartTime.TabIndex = 38; + this.GB_FestaStartTime.TabStop = false; + this.GB_FestaStartTime.Text = "Latest Start Time"; + // + // GB_Reward + // + this.GB_Reward.Controls.Add(this.B_AllReadyReward); + this.GB_Reward.Controls.Add(this.CLB_Reward); + this.GB_Reward.Controls.Add(this.B_AllReceiveReward); + this.GB_Reward.Location = new System.Drawing.Point(267, 95); + this.GB_Reward.Name = "GB_Reward"; + this.GB_Reward.Size = new System.Drawing.Size(200, 168); + this.GB_Reward.TabIndex = 39; + this.GB_Reward.TabStop = false; + this.GB_Reward.Text = "RankUP rewards"; + // + // B_AllReadyReward + // + this.B_AllReadyReward.Location = new System.Drawing.Point(9, 50); + this.B_AllReadyReward.Name = "B_AllReadyReward"; + this.B_AllReadyReward.Size = new System.Drawing.Size(131, 23); + this.B_AllReadyReward.TabIndex = 2; + this.B_AllReadyReward.Text = "All ready to receive"; + this.B_AllReadyReward.UseVisualStyleBackColor = true; + this.B_AllReadyReward.Click += new System.EventHandler(this.B_AllReadyReward_Click); + // + // CLB_Reward + // + this.CLB_Reward.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.CLB_Reward.CheckOnClick = true; + this.CLB_Reward.FormattingEnabled = true; + this.CLB_Reward.IntegralHeight = false; + this.CLB_Reward.Location = new System.Drawing.Point(9, 82); + this.CLB_Reward.Name = "CLB_Reward"; + this.CLB_Reward.Size = new System.Drawing.Size(182, 77); + this.CLB_Reward.TabIndex = 1; + this.CLB_Reward.ThreeDCheckBoxes = true; + // + // B_AllReceiveReward + // + this.B_AllReceiveReward.Location = new System.Drawing.Point(9, 21); + this.B_AllReceiveReward.Name = "B_AllReceiveReward"; + this.B_AllReceiveReward.Size = new System.Drawing.Size(131, 23); + this.B_AllReceiveReward.TabIndex = 0; + this.B_AllReceiveReward.Text = "All received"; + this.B_AllReceiveReward.UseVisualStyleBackColor = true; + this.B_AllReceiveReward.Click += new System.EventHandler(this.B_AllReceiveReward_Click); + // + // NUD_Rank + // + this.NUD_Rank.Location = new System.Drawing.Point(353, 13); + this.NUD_Rank.Maximum = new decimal(new int[] { + 999, + 0, + 0, + 0}); + this.NUD_Rank.Name = "NUD_Rank"; + this.NUD_Rank.Size = new System.Drawing.Size(47, 19); + this.NUD_Rank.TabIndex = 40; + this.NUD_Rank.Value = new decimal(new int[] { + 999, + 0, + 0, + 0}); + this.NUD_Rank.ValueChanged += new System.EventHandler(this.NUD_Rank_ValueChanged); + // + // L_Rank + // + this.L_Rank.Location = new System.Drawing.Point(301, 12); + this.L_Rank.Name = "L_Rank"; + this.L_Rank.Size = new System.Drawing.Size(46, 18); + this.L_Rank.TabIndex = 41; + this.L_Rank.Text = "Rank"; + this.L_Rank.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // GB_MyMessage + // + this.GB_MyMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.GB_MyMessage.Controls.Add(this.NUD_MyMessage); + this.GB_MyMessage.Controls.Add(this.CB_MyMessage); + this.GB_MyMessage.Location = new System.Drawing.Point(304, 37); + this.GB_MyMessage.Name = "GB_MyMessage"; + this.GB_MyMessage.Size = new System.Drawing.Size(154, 49); + this.GB_MyMessage.TabIndex = 59; + this.GB_MyMessage.TabStop = false; + this.GB_MyMessage.Text = "my message"; + // + // NUD_MyMessage + // + this.NUD_MyMessage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.NUD_MyMessage.Location = new System.Drawing.Point(98, 21); + this.NUD_MyMessage.Maximum = new decimal(new int[] { + 9999, + 0, + 0, + 0}); + this.NUD_MyMessage.Name = "NUD_MyMessage"; + this.NUD_MyMessage.Size = new System.Drawing.Size(47, 19); + this.NUD_MyMessage.TabIndex = 1; + this.NUD_MyMessage.Value = new decimal(new int[] { + 9999, + 0, + 0, + 0}); + this.NUD_MyMessage.ValueChanged += new System.EventHandler(this.NUD_MyMessage_ValueChanged); + // + // CB_MyMessage + // + this.CB_MyMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.CB_MyMessage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CB_MyMessage.DropDownWidth = 102; + this.CB_MyMessage.FormattingEnabled = true; + this.CB_MyMessage.Location = new System.Drawing.Point(9, 21); + this.CB_MyMessage.Name = "CB_MyMessage"; + this.CB_MyMessage.Size = new System.Drawing.Size(83, 20); + this.CB_MyMessage.TabIndex = 0; + this.CB_MyMessage.SelectedIndexChanged += new System.EventHandler(this.CB_MyMessage_SelectedIndexChanged); + // + // L_Note + // + this.L_Note.Location = new System.Drawing.Point(12, 437); + this.L_Note.Name = "L_Note"; + this.L_Note.Size = new System.Drawing.Size(299, 33); + this.L_Note.TabIndex = 60; + this.L_Note.Text = "note: If facility is NOT introduced by visitor,\r\n this form delete all of visitor" + + "s data of the facility."; + this.L_Note.Visible = false; + // + // SAV_FestivalPlaza + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(485, 479); + this.Controls.Add(this.L_Note); + this.Controls.Add(this.GB_MyMessage); + this.Controls.Add(this.L_Rank); + this.Controls.Add(this.NUD_Rank); + this.Controls.Add(this.GB_Reward); + this.Controls.Add(this.GB_FestaStartTime); + this.Controls.Add(this.GB_Facility); + this.Controls.Add(this.GB_Phrase); + this.Controls.Add(this.B_Save); + this.Controls.Add(this.B_Cancel); + this.Controls.Add(this.GB_FC); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SAV_FestivalPlaza"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Festival Plaza Editor"; + ((System.ComponentModel.ISupportInitialize)(this.NUD_FC_Current)).EndInit(); + this.GB_FC.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.NUD_FC_Used)).EndInit(); + this.GB_Phrase.ResumeLayout(false); + this.GB_Facility.ResumeLayout(false); + this.GB_Facility.PerformLayout(); + this.GB_FacilityMessage.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityMessage)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityColor)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityIndex)).EndInit(); + this.GB_FestaStartTime.ResumeLayout(false); + this.GB_Reward.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.NUD_Rank)).EndInit(); + this.GB_MyMessage.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.NUD_MyMessage)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.NumericUpDown NUD_FC_Current; + private System.Windows.Forms.Label L_FC_Current; + private System.Windows.Forms.GroupBox GB_FC; + private System.Windows.Forms.NumericUpDown NUD_FC_Used; + private System.Windows.Forms.Label L_FC_Used; + private System.Windows.Forms.Label L_FC_CollectedV; + private System.Windows.Forms.Label L_FC_CollectedL; + private System.Windows.Forms.Button B_Save; + private System.Windows.Forms.Button B_Cancel; + private System.Windows.Forms.GroupBox GB_Phrase; + private System.Windows.Forms.Button B_AllPhrases; + private System.Windows.Forms.CheckedListBox CLB_Phrases; + private System.Windows.Forms.TextBox TB_OTName; + private System.Windows.Forms.GroupBox GB_Facility; + private System.Windows.Forms.DateTimePicker CAL_FestaStartDate; + private System.Windows.Forms.DateTimePicker CAL_FestaStartTime; + private System.Windows.Forms.GroupBox GB_FestaStartTime; + private System.Windows.Forms.GroupBox GB_Reward; + private System.Windows.Forms.CheckedListBox CLB_Reward; + private System.Windows.Forms.Button B_AllReceiveReward; + private System.Windows.Forms.Button B_AllReadyReward; + private System.Windows.Forms.NumericUpDown NUD_FacilityIndex; + private System.Windows.Forms.CheckBox CHK_FacilityIntroduced; + private System.Windows.Forms.Label L_FacilityNPC; + private System.Windows.Forms.NumericUpDown NUD_FacilityColor; + private System.Windows.Forms.Label L_FacilityColor; + private System.Windows.Forms.Label L_FacilityType; + private System.Windows.Forms.Label L_FacilityIndex; + private System.Windows.Forms.ComboBox CB_FacilityNPC; + private System.Windows.Forms.ComboBox CB_FacilityType; + private System.Windows.Forms.Label Label_OTGender; + private System.Windows.Forms.GroupBox GB_FacilityMessage; + private System.Windows.Forms.ComboBox CB_FacilityMessage; + private System.Windows.Forms.NumericUpDown NUD_FacilityMessage; + private System.Windows.Forms.ComboBox CB_FacilityID; + private System.Windows.Forms.TextBox TB_FacilityID; + private System.Windows.Forms.NumericUpDown NUD_Rank; + private System.Windows.Forms.Label L_Rank; + private System.Windows.Forms.Label L_VisitorMisc; + private System.Windows.Forms.GroupBox GB_MyMessage; + private System.Windows.Forms.NumericUpDown NUD_MyMessage; + private System.Windows.Forms.ComboBox CB_MyMessage; + private System.Windows.Forms.Label L_FacilityColorV; + private System.Windows.Forms.Label L_Note; + } +} \ No newline at end of file diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_FestivalPlaza.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_FestivalPlaza.cs new file mode 100644 index 000000000..35cf5d593 --- /dev/null +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_FestivalPlaza.cs @@ -0,0 +1,516 @@ +using System; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using PKHeX.Core; + +namespace PKHeX.WinForms +{ + public partial class SAV_FestivalPlaza : Form + { + private readonly SaveFile Origin; + private readonly SAV7 SAV; + public SAV_FestivalPlaza(SaveFile sav) + { + SAV = (SAV7)(Origin = sav).Clone(); + editing = true; + InitializeComponent(); + typeMAX = SAV.USUM ? 0x7F : 0x7C; + if (Main.Unicode) + try { TB_OTName.Font = FontUtil.GetPKXFont(11); } + catch (Exception e) { WinFormsUtil.Alert("Font loading failed...", e.ToString()); } + uint cc = SAV.FestaCoins; + uint cu = SAV.UsedFestaCoins; + NUD_FC_Current.Value = Math.Min(cc, NUD_FC_Current.Maximum); + NUD_FC_Used.Value = Math.Min(cu, NUD_FC_Used.Maximum); + L_FC_CollectedV.Text = (cc + cu).ToString(); + string[] res; + switch (Main.CurrentLanguage) + { + case "ja": + res = new string[107] { + "おじさんの きんのたま だからね!","かがくの ちからって すげー","1 2の …… ポカン!","おーす! みらいの チャンピオン!","おお! あんたか!","みんな げんきに なりましたよ!","とっても 幸せそう!","なんでも ないです","いあいぎりで きりますか?","レポートを かきこんでいます", + "…… ぼくも もう いかなきゃ!","ボンジュール!","バイビー!","ばか はずれです……","やけどなおしの よういは いいか!","ウー! ハーッ!","ポケモンは たたかわせるものさ","ヤドランは そっぽを むいた!","マサラは まっしろ はじまりのいろ","10000こうねん はやいんだよ!","おーい! まてー! まつんじゃあ!","こんちわ! ぼく ポケモン……!","っだと こらあ!","ぐ ぐーッ! そんな ばかなーッ!","みゅう!","タチサレ…… タチサレ……", + "カイリュー はかいこうせん","どっちか 遊んでくれないか?","ぬいぐるみ かっておいたわよ","ひとのこと じろじろ みてんなよ","なんのことだか わかんない","みんな ポケモン やってるやん","きょうから 24時間 とっくんだ!","あたいが ホンモノ!","でんげきで いちころ……","スイクンを おいかけて 10ねん","かんどうが よみがえるよ!","われわれ ついに やりましたよー!","ヤドンのシッポを うるなんて……","ショオーッ!!","ギャーアアス!!","だいいっぽを ふみだした!", + "いちばん つよくて すごいんだよね","にくらしいほど エレガント!","そうぞうりょくが たりないよ","キミは ビッグウェーブ!","おまえさんには しびれた わい","なに いってんだろ…… てへへ……","ぬいぐるみ なんか かってないよ","ここで ゆっくり して おいき!","はじけろ! ポケモン トレーナー!","はいが はいに はいった……","…できる!","ぶつかった かいすう 5かい!","たすけて おくれーっ!!","マボロシじま みえんのう……","ひゅああーん!","しゅわーん!", + "あつい きもち つたわってくる!","こいつが! おれの きりふだ!","ひとりじめとか そういうの ダメよ!","ワーオ! ぶんせきどーり!","ぱるぱるぅ!!!","グギュグバァッ!!!","ばっきん 100まんえん な!","オレ つよくなる……","ながれる 時間は とめられない!","ぜったいに お願いだからね","きみたちから はどうを かんじる!","あたしのポケモンに なにすんのさ!","リングは おれの うみ~♪","オレの おおごえの ひとりごとを","そう コードネームは ハンサム!","……わたしが まけるかも だと!?", + "やめたげてよぉ!","ブラボー! スーパー ブラボー!","ボクは チャンピオンを こえる","オレは いまから いかるぜッ!","ライモンで ポケモン つよいもん","キミ むしポケモン つかいなよ","ストップ!","ひとよんで メダルおやじ!","トレーナーさんも がんばれよ!","おもうぞんぶん きそおーぜ!","プラズマズイ!","ワタクシを とめることは できない!","けいさんずみ ですとも!","ババリバリッシュ!","ンバーニンガガッ!","ヒュラララ!", + "お友達に なっちゃお♪","じゃあ みんな またねえ!","このひとたち ムチャクチャです……","トレーナーとは なにか しりたい","スマートに くずれおちるぜ","いのち ばくはつッ!!","いいんじゃない いいんじゃないの!","あれだよ あれ おみごとだよ!","ぜんりょくでいけー! ってことよ!","おまちなさいな!","つまり グッド ポイント なわけ!","ざんねん ですが さようなら","にくすぎて むしろ 好きよ","この しれもの が!","イクシャア!!","イガレッカ!!", + "フェスサークル ランク 100!", + }; + break; + case "en": + default: + string musical8note = char.ConvertFromUtf32(0x266A); + string linedP = char.ConvertFromUtf32(0x20BD);//currency Ruble + res = new string[107] { //source:UltraMoon + /* (SM)Pokémon House */"There's nothing funny about Nuggets.","The Power of science is awesome.","1, 2, and... Ta-da!","How's the future Champ today?","Why, you!","There! All happy and healthy!","Your Pokémon seems to be very happy!","No thanks!","Would you like to use Cut?","Saving...", + /* (SM)Kanto Tent */"Well, I better get going!","Bonjour!","Smell ya later!","Sorry! Bad call!","You better have Burn Heal!","Hoo hah!","Pokémon are for battling!","Slowbro took a snooze...","Shades of your journey await!","You're 10,000 light-years from facing Brock!","Hey! Wait! Don't go out!","Hiya! I'm a Pokémon...","What do you want?","WHAT! This can't be!","Mew!","Be gone... Intruders...", + /* (SM)Joht Tent */"Dragonite, Hymer Beam.","Spread the fun around.","I bought an adorable doll with your money.","What are you staring at?","I just don't understand.","Everyone is into Pokémon.","I'm going to train 24 hours a day!","I'm the real deal!","With a jolt of electricity...","For 10 years I chased Suicune.","I am just so deeply moved!","We have finally made it!","...But selling Slowpoke Tails?","Shaoooh!","Gyaaas!","you've taken your first step!", + /* (SM)Hoenn Tent */"I'm just the strongest there is right now.","And confoundedly elegant!","You guys need some imagination.","You made a much bigger splash!","You ended up giving me a thrill!","So what am I talking about...","I'm not buying any Dolls.","Take your time and rest up!","Have a blast, Pokémon Trainers!","I got ashes in my eyelashes!","You're sharp!","Number of collisions: 5 times!","Please! Help me out!","I can't see Mirage Island today...","Hyahhn!","Shwahhn!", + /* (SM)Sinnoh Tent */"Your will is overwhelming me!","This is it! My trump card!","Trying to monopolize Pokémon just isn't...","See? Just as analyzed.","Gagyagyaah!","Gugyugubah!","It's a "+linedP+"10 million fine if you're late!","I'm going to get tougher...","You'll never be able to stem the flow of time!","Please come!","Your team! I sense your strong aura!","What do you think you're doing?!","The ring is my rolling sea. "+musical8note,"I was just thinking out loud.","My code name, it is Looker.","It's not possible that I lose!", + /* (SM)Unova Tent */"Knock it off!","Bravo! Excellent!!","I'll defeat the Champion.","You're about to feel my rage!","Nimbasa's Pokémon can dance a nimble bossa!","Use Bug-type Pokémon!","Stop!","People call me Mr. Medal!","Trainer, do your best, too!","See who's stronger!","Plasbad, for short!","I won't allow anyone to stop me!","I was expecting exactly that kind of move!","Bazzazzazzash!","Preeeeaah!","Haaahraaan!", + /* (SM)Kalos Tent */"We'll become friends. "+musical8note,"I'll see you all later!","These people have a few screws loose...","I want to know what a \"Trainer\" is.","When I lose, I go out in style!","Let's give it all we've got!","Fantastic! Just fantastic!","Outstanding!","Try as hard as possible!","Stop right there!","That really hit me right here...","But this is adieu to you all.","You're just too much, you know?","Fool! You silly, unseeing child!","Xsaaaaaah!","Yvaaaaaar!", + "I reached Festival Plaza Rank 100!", + }; + break; + } + CLB_Phrases.Items.Clear(); + CLB_Phrases.Items.Add(res.Last(), SAV.getFestaPhraseUnlocked(106)); //add Lv100 before TentPhrases + for (int i = 0; i < res.Length - 1; i++) + CLB_Phrases.Items.Add(res[i], SAV.getFestaPhraseUnlocked(i)); + + DateTime dt = SAV.FestaDate ?? new DateTime(2000, 1, 1); + CAL_FestaStartDate.Value = dt; + CAL_FestaStartTime.Value = dt; + + string[] res2 = { "Rank 4: missions","Rank 8: facility","Rank 10: facion","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.Last(), (CheckState)r[SAV.getFestPrizeReceived(10)]); //add CurrentRank before const-rewards + for (int i = 0; i < res2.Length - 1; i++) + CLB_Reward.Items.Add(res2[i], (CheckState)r[SAV.getFestPrizeReceived(i)]); + + for (int i = 0; i < 7; i++) + f[i] = new FestaFacility(SAV, i); + + string[] res3 = { "Meet", "Part", "Moved", "Disappointed" }; + CB_FacilityMessage.Items.Clear(); + CB_FacilityMessage.Items.AddRange(res3); + CB_MyMessage.Items.Clear(); + CB_MyMessage.Items.AddRange(res3); + string[] res4 = { "misc1", "misc2", "FestaID" }; + CB_FacilityID.Items.Clear(); + CB_FacilityID.Items.AddRange(res4); + string[] res5 = { "Ace Trainer", "Ace Trainer", "Veteran", "Veteran", "Office Worker", "Office Worker", "Punk Guy", "Punk Girl", "Breeder", "Breeder", "Youngster", "Lass" }; + CB_FacilityNPC.Items.Clear(); + for(int i = 0; i < res5.Length; i++) + { + switch (i) + { + case 1: + case 3: + case 4: + case 8: CB_FacilityNPC.Items.Add(res5[i] + gendersymbols[0]); break; + case 0: + case 2: + case 5: + case 9: CB_FacilityNPC.Items.Add(res5[i] + gendersymbols[1]); break; + default: CB_FacilityNPC.Items.Add(res5[i]); break; + } + } + string[] res6 = { "Lottery", "Haunted", "Goody", "Food", "Bouncy", "Fortune", "Dye","Exchange" }; + string[][] res7 = { + new string[]{"BigDream","GoldRush","TreasureHunt"}, + new string[]{"GhostsDen","TrickRoom","ConfuseRay"}, + new string[]{"Ball","General","Battle","SoftDrink","Pharmacy"}, + new string[]{"Rare","Battle", "FriendshipCafé", "FriendshipParlor"}, + new string[]{"Thump","Clink","Stomp"}, + new string[]{"Kanto","Johto","Hoenn","Sinnoh","Unova","Kalos","Pokémon"}, + new string[]{"Red","Yellow","Green","Blue","Orange","NavyBlue","Purple","Pink"}, + new string[]{"Switcheroo"} + }; + CB_FacilityType.Items.Clear(); + for (int k = 0; k < RES_FacilityLevelType.Length - (SAV.USUM ? 0 : 1); k++) //Exchange is USUM only + for (int j = 0; j < RES_FacilityLevelType[k].Length; j++) + { + if (RES_FacilityLevelType[k][j] != 4) + for (int i = 0; i < RES_FacilityLevelType[k][j]; i++) + CB_FacilityType.Items.Add(res6[k] + " " + res7[k][j] + " " + (i + 1)); + else + { + CB_FacilityType.Items.Add(res6[k] + " " + res7[k][j] + " 1"); + CB_FacilityType.Items.Add(res6[k] + " " + res7[k][j] + " 3"); + CB_FacilityType.Items.Add(res6[k] + " " + res7[k][j] + " 5"); + } + } + + NUD_Rank.Value = SAV.FestaRank; + CB_MyMessage.SelectedIndex = 0; + loadMMessage(0); + NUD_FacilityIndex.Value = 0; + CB_FacilityMessage.SelectedIndex = 0; + CB_FacilityID.SelectedIndex = 0; + editing = false; + loadFacility(0); + } + private bool editing; + private readonly byte[] r = { 0, 2, 1 }; // CheckState.Indeterminate <-> CheckState.Checked + private readonly int typeMAX; + private FestaFacility[] f = new FestaFacility[7]; + private string[] RES_Color = { "Red", "Blue", "Gold", "Black", "Purple", "Yellow", "Brown", "Green", "Orange", "NavyBlue", "Pink", "White" }; + private byte[][] RES_FacilityColor = //facility appearance + { + new byte[]{0,1,2,3},//Lottery + new byte[]{4,0,5,3},//Haunted + new byte[]{1,0,5,3},//Goody + new byte[]{6,7,0,3},//Food + new byte[]{4,5,8,3},//Bouncy + new byte[]{0,1,2,3},//Fortune + new byte[]{0,7,8,4,5,2,9,10},//Dye + new byte[]{11,1,5,3},//Exchange + }; + private byte[][] RES_FacilityLevelType = //3:123 4:135 5:12345 + { + new byte[]{5,5,5}, + new byte[]{5,5,5}, + new byte[]{3,5,3,3,3}, + new byte[]{5,4,5,5}, + new byte[]{5,5,5}, + new byte[]{4,4,4,4,4,4,4}, + new byte[]{4,4,4,4,4,4,4,4}, + new byte[]{3} + }; + private int typeIndexToType(int typeIndex) + { + if (typeIndex < 0 || typeIndex > typeMAX) return -1; + else if (typeIndex < 0x0F) return 0; + else if (typeIndex < 0x1E) return 1; + else if (typeIndex < 0x2F) return 2; + else if (typeIndex < 0x41) return 3; + else if (typeIndex < 0x50) return 4; + else if (typeIndex < 0x65) return 5; + else if (typeIndex < 0x7D) return 6; + else return 7; + } + private int getColorCount(int i) => + i >= 0 && i < RES_FacilityColor.Length - (SAV.USUM ? 0 : 1) + ? RES_FacilityColor[i].Length - 1 + : 3; + private void loadFacility(int index) + { + editing = true; + CB_FacilityType.SelectedIndex = + CB_FacilityType.Items.Count > f[index].type + ? f[index].type + : -1; + int type = typeIndexToType(CB_FacilityType.SelectedIndex); + NUD_FacilityColor.Maximum = getColorCount(type); + NUD_FacilityColor.Value = Math.Min(f[index].color, NUD_FacilityColor.Maximum); + if (type >= 0) loadColorLabel(type); + CB_FacilityNPC.SelectedIndex = + CB_FacilityNPC.Items.Count > f[index].npc + ? f[index].npc + : 0; + CHK_FacilityIntroduced.Checked = f[index].introduced; + TB_OTName.Text = f[index].trainerName; + loadOTlabel(f[index].trainerGender); + if (CB_FacilityMessage.SelectedIndex >= 0) loadFMessage(CB_FacilityMessage.SelectedIndex); + if (CB_FacilityID.SelectedIndex >= 0) loadFestID(CB_FacilityID.SelectedIndex); + editing = false; + } + private void Save() + { + SAV.setFestaPhraseUnlocked(106, CLB_Phrases.GetItemChecked(0)); + for (int i = 1; i < CLB_Phrases.Items.Count; i++) + SAV.setFestaPhraseUnlocked(i - 1, CLB_Phrases.GetItemChecked(i)); + + SAV.UsedFestaCoins = (uint)NUD_FC_Used.Value; + SAV.FestaCoins = (uint)NUD_FC_Current.Value; + SAV.FestaDate = new DateTime(CAL_FestaStartDate.Value.Year, CAL_FestaStartDate.Value.Month, CAL_FestaStartDate.Value.Day, CAL_FestaStartTime.Value.Hour, CAL_FestaStartTime.Value.Minute, CAL_FestaStartTime.Value.Second); + + SAV.setFestaPrizeReceived(10, r[(int)CLB_Reward.GetItemCheckState(0)]); + for (int i = 1; i < CLB_Reward.Items.Count; i++) + SAV.setFestaPrizeReceived(i - 1, r[(int)CLB_Reward.GetItemCheckState(i)]); + + for (int i = 0; i < f.Length; i++) + f[i].CopyTo(SAV); + } + private void NUD_FC_ValueChanged(object sender, EventArgs e) + { + if (editing) return; + L_FC_CollectedV.Text = (NUD_FC_Current.Value + NUD_FC_Used.Value).ToString(); + } + + private void B_Cancel_Click(object sender, EventArgs e) + { + Close(); + } + + private void B_Save_Click(object sender, EventArgs e) + { + Save(); + Origin.SetData(SAV.Data, 0); + Close(); + } + + private void B_AllReceiveReward_Click(object sender, EventArgs e) + { + for (int i = 0; i < CLB_Reward.Items.Count; i++) + CLB_Reward.SetItemCheckState(i, CheckState.Checked); + } + + private void B_AllReadyReward_Click(object sender, EventArgs e) + { + for (int i = 0; i < CLB_Reward.Items.Count; i++) + CLB_Reward.SetItemCheckState(i, CheckState.Indeterminate); + } + + private void B_AllPhrases_Click(object sender, EventArgs e) + { + for (int i = 0; i < CLB_Phrases.Items.Count; i++) + CLB_Phrases.SetItemChecked(i, true); + } + + private void TB_OTName_MouseDown(object sender, MouseEventArgs e) + { + TextBox tb = sender as TextBox ?? TB_OTName; + // Special Character Form + if (ModifierKeys != Keys.Control) + return; + + var d = new TrashEditor(tb, null, SAV); + d.ShowDialog(); + tb.Text = d.FinalString; + } + private readonly string[] gendersymbols = { "♂", "♀" }; + private void loadOTlabel(bool b) + { + Label_OTGender.Text = gendersymbols[b ? 1 : 0]; + Label_OTGender.ForeColor = b ? Color.Red : Color.Blue; + } + private void Label_OTGender_Click(object sender, EventArgs e) + { + int fIndex = (int)NUD_FacilityIndex.Value; + bool b = f[fIndex].trainerGender; + b = !b; + f[fIndex].trainerGender = b; + loadOTlabel(b); + } + private void loadFMessage(int fmIndex) => NUD_FacilityMessage.Value = f[(int)NUD_FacilityIndex.Value].GetMessage(fmIndex); + private void CB_FacilityMessage_SelectedIndexChanged(object sender, EventArgs e) + { + if (editing) return; + int fmIndex = CB_FacilityMessage.SelectedIndex; + if (fmIndex < 0) return; + editing = true; + loadFMessage(fmIndex); + editing = false; + } + + private void NUD_FacilityMessage_ValueChanged(object sender, EventArgs e) + { + if (editing) return; + int fmIndex = CB_FacilityMessage.SelectedIndex; + if (fmIndex < 0) return; + f[(int)NUD_FacilityIndex.Value].SetMessage(fmIndex, (ushort)NUD_FacilityMessage.Value); + } + private void loadFestID(int m) + { + int fIndex = (int)NUD_FacilityIndex.Value; + switch (m) + { + case 0: TB_FacilityID.Text = f[fIndex].misc1.ToString("X8"); break; + case 1: TB_FacilityID.Text = f[fIndex].misc2.ToString("X8"); break; + case 2: + StringBuilder stringBuilder = new StringBuilder(f[fIndex].trainerFesID.Length << 1); + for (int j = f[fIndex].trainerFesID.Length - 1; j >= 0; j--) + stringBuilder.Append(f[fIndex].trainerFesID[j].ToString("X2")); + TB_FacilityID.Text = stringBuilder.ToString(); + break; + } + + } + private void CB_FacilityID_SelectedIndexChanged(object sender, EventArgs e) + { + if (editing) return; + int fiIndex = CB_FacilityID.SelectedIndex; + if (fiIndex < 0) return; + editing = true; + loadFestID(fiIndex); + editing = false; + } + + private void TB_FacilityID_TextChanged(object sender, EventArgs e) + { + if (editing) return; + int fIndex = (int)NUD_FacilityIndex.Value; + int fiIndex = CB_FacilityID.SelectedIndex; + string t = System.Text.RegularExpressions.Regex.Replace(TB_FacilityID.Text, "[^A-Fa-f0-9]", "0"); + int maxlen = fiIndex == 2 ? 12 << 1 : 4 << 1; + if (t.Length > maxlen) + { + t = t.Substring(0, maxlen); + editing = true; + TB_FacilityID.Text = t; + editing = false; + System.Media.SystemSounds.Beep.Play(); + } + switch (fiIndex) + { + case 0: f[fIndex].misc1 = Convert.ToUInt32(t, 16); break; + case 1: f[fIndex].misc2 = Convert.ToUInt32(t, 16); break; + case 2: + int w = 0; + for (int j = 0, k = t.Length - 2; k + 1 >= 0; j++, k -= 2) + f[fIndex].trainerFesID[w++] = Convert.ToByte(k < 0 ? t.Substring(0, 1) : t.Substring(k, 2), 16); + for (int j = w; j < f[fIndex].trainerFesID.Length; j++) + f[fIndex].trainerFesID[j] = 0; + break; + } + } + private void loadColorLabel(int type) => L_FacilityColorV.Text = RES_Color[RES_FacilityColor[type][(int)NUD_FacilityColor.Value]]; + private void NUD_FacilityColor_ValueChanged(object sender, EventArgs e) + { + if (editing) return; + f[(int)NUD_FacilityIndex.Value].type = (byte)NUD_FacilityColor.Value; + int type = typeIndexToType(CB_FacilityType.SelectedIndex); + if (type < 0) return; + editing = true; + loadColorLabel(type); + editing = false; + } + + private void CB_FacilityType_SelectedIndexChanged(object sender, EventArgs e) + { + if (editing) return; + int fIndex = (int)NUD_FacilityIndex.Value; + int typeIndex = CB_FacilityType.SelectedIndex; + if (typeIndex < 0) return; + f[fIndex].type = (byte)typeIndex; + int type = typeIndexToType(typeIndex); + int colorCount = getColorCount(type); + editing = true; + if (colorCount < NUD_FacilityColor.Value) + { + NUD_FacilityColor.Value = colorCount; + f[fIndex].color = (byte)colorCount; + } + NUD_FacilityColor.Maximum = colorCount; + loadColorLabel(type); + editing = false; + } + + private void NUD_FacilityIndex_ValueChanged(object sender, EventArgs e) + { + if (editing) return; + loadFacility((int)NUD_FacilityIndex.Value); + } + + private void NUD_Rank_ValueChanged(object sender, EventArgs e) + { + if (editing) return; + SAV.FestaRank = (ushort)NUD_Rank.Value; + } + private void loadMMessage(int mmIndex) => NUD_MyMessage.Value = SAV.getFestaMessage(mmIndex); + private void CB_MyMessage_SelectedIndexChanged(object sender, EventArgs e) + { + if (editing) return; + int mmIndex = CB_MyMessage.SelectedIndex; + if (mmIndex < 0) return; + editing = true; + loadMMessage(mmIndex); + editing = false; + } + + private void NUD_MyMessage_ValueChanged(object sender, EventArgs e) + { + if (editing) return; + int mmIndex = CB_MyMessage.SelectedIndex; + if (mmIndex < 0) return; + SAV.setFestaMessage(mmIndex, (ushort)NUD_MyMessage.Value); + } + + private void CHK_FacilityIntroduced_CheckedChanged(object sender, EventArgs e) + { + if (editing) return; + int fIndex = (int)NUD_FacilityIndex.Value; + f[fIndex].introduced = CHK_FacilityIntroduced.Checked; + if (!L_Note.Visible && !f[fIndex].introduced && ( + f[fIndex].trainerName.Length > 0 + || f[fIndex].GetMessage(0) != 0 + || f[fIndex].GetMessage(1) != 0 + || f[fIndex].GetMessage(2) != 0 + || f[fIndex].GetMessage(3) != 0 + || f[fIndex].misc1 != 0 + || f[fIndex].misc2 != 0 + || f[fIndex].trainerFesID.Any(v => v != 0) + )) L_Note.Visible = true; + } + + private void TB_OTName_TextChanged(object sender, EventArgs e) + { + if (editing) return; + f[(int)NUD_FacilityIndex.Value].trainerName = TB_OTName.Text; + } + } + public class FestaFacility + { + public byte type; + public byte color; + public bool introduced; + public bool trainerGender; + public string trainerName; + private ushort messageMeet, messagePart, messageMoved, messageDisappointed; + public uint misc1, misc2; + public int npc; + public byte[] trainerFesID; + private int ofs; + public FestaFacility(SAV7 sav, int facilityIndex) + { + ofs = facilityIndex * 0x48 + (sav.USUM ? 0x51110 : 0x50B10); + type = sav.Data[ofs]; + color = sav.Data[ofs + 1]; + introduced = sav.Data[ofs + 2] != 0; + trainerGender = sav.Data[ofs + 3] != 0; + trainerName = sav.GetString(ofs + 4, 12 << 1); + messageMeet = messageFilter(BitConverter.ToUInt16(sav.Data, ofs + 0x1E)); + messagePart = messageFilter(BitConverter.ToUInt16(sav.Data, ofs + 0x20)); + messageMoved = messageFilter(BitConverter.ToUInt16(sav.Data, ofs + 0x22)); + messageDisappointed = messageFilter(BitConverter.ToUInt16(sav.Data, ofs + 0x24)); + misc1 = BitConverter.ToUInt32(sav.Data, ofs + 0x28); + misc2 = BitConverter.ToUInt32(sav.Data, ofs + 0x2C); + npc = Math.Max(0, BitConverter.ToInt32(sav.Data, ofs + 0x30)); + trainerFesID = sav.Data.Skip(ofs + 0x34).Take(12).ToArray(); + } + private ushort messageFilter(ushort inp) => Math.Min(inp, (ushort)0xFFF); + public void CopyTo(SAV7 sav) + { + sav.Data[ofs] = type; + sav.Data[ofs + 1] = color; + if (introduced) + { + sav.Data[ofs + 2] = Convert.ToByte(introduced); + sav.Data[ofs + 3] = Convert.ToByte(trainerGender); + sav.SetString(trainerName, 12).CopyTo(sav.Data, ofs + 4); + BitConverter.GetBytes(messageMeet).CopyTo(sav.Data, ofs + 0x1E); + BitConverter.GetBytes(messagePart).CopyTo(sav.Data, ofs + 0x20); + BitConverter.GetBytes(messageMoved).CopyTo(sav.Data, ofs + 0x22); + BitConverter.GetBytes(messageDisappointed).CopyTo(sav.Data, ofs + 0x24); + BitConverter.GetBytes(misc1).CopyTo(sav.Data, ofs + 0x28); + BitConverter.GetBytes(misc2).CopyTo(sav.Data, ofs + 0x2C); + BitConverter.GetBytes(npc).CopyTo(sav.Data, ofs + 0x30); + trainerFesID.CopyTo(sav.Data, ofs + 0x34); + } + else + { + byte[] fid = new byte[0x40 - 2]; + BitConverter.GetBytes(npc).CopyTo(fid, 0x2E); + fid.CopyTo(sav.Data, ofs + 2); + } + } + public ushort GetMessage(int index) + { + switch (index) + { + case 0: return messageMeet; + case 1: return messagePart; + case 2: return messageMoved; + case 3: return messageDisappointed; + default: return 0; + } + } + public void SetMessage(int index, ushort value) + { + value = messageFilter(value); + switch (index) + { + case 0: messageMeet = value; break; + case 1: messagePart = value; break; + case 2: messageMoved = value; break; + case 3: messageDisappointed = value; break; + default: return; + } + } + } +} diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_FestivalPlaza.resx b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_FestivalPlaza.resx new file mode 100644 index 000000000..603f660be --- /dev/null +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_FestivalPlaza.resx @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAE + AAAAAAAAAAAAAAAAAAAAAAAAIyMjAQAAAAALCwsPJiYmJysrKycqKionKSkpJykpKScpKSknKioqJyoq + KicrKysnJycnJw0ODQ8AAAAAJiYmAQAAAABpaWlHq6ur17+/v+6+vr7svr6+7b6+vu2+vr7tvr6+7b6+ + vu2+vr7tvr6+7L+/v+6rq6vXampqSAAAAAAoKSgXvr++3eLi4v/g4OD94eHh/+Hh4f/i4uL/4uLi/+Li + 4v/i4uL/4eHh/+Dh4P/g4OD94uLi/7+/v90sLCwXfn5+PNna2frg4OD/39/f/uHh4f7h4eH+39/f/uDg + 4P7g4OD+39/f/uHh4f7h4OH+39/f/t/g3//a2tr6g4ODPoOCgz7X19f64+Pj/+Li4v7k5OT/4+Tj//Ly + 8v/19fX/9PT0//T09P/k5OT/5OTk/+Pj4/7j4+P/19jX+4qLikCDh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