fix FestaPlazaEdit value

found "misc value" as used stats.
exchange left count is also up to 255.
(value 0x83 shows "?", 0x103 shows "3")
fix dye#5(blue) color value
This commit is contained in:
pokecal 2017-11-20 19:08:38 +09:00
parent 6534ef1919
commit 16a0abaf62
2 changed files with 142 additions and 103 deletions

View file

@ -43,8 +43,11 @@
this.B_AllPhrases = new System.Windows.Forms.Button(); this.B_AllPhrases = new System.Windows.Forms.Button();
this.TB_OTName = new System.Windows.Forms.TextBox(); this.TB_OTName = new System.Windows.Forms.TextBox();
this.GB_Facility = new System.Windows.Forms.GroupBox(); this.GB_Facility = new System.Windows.Forms.GroupBox();
this.L_Exchangable = new System.Windows.Forms.Label();
this.NUD_Exchangable = new System.Windows.Forms.NumericUpDown();
this.LB_FacilityIndex = new System.Windows.Forms.ListBox();
this.L_FacilityColorV = new System.Windows.Forms.Label(); this.L_FacilityColorV = new System.Windows.Forms.Label();
this.L_VisitorMisc = new System.Windows.Forms.Label(); this.L_OtherValue = new System.Windows.Forms.Label();
this.TB_FacilityID = new System.Windows.Forms.TextBox(); this.TB_FacilityID = new System.Windows.Forms.TextBox();
this.CB_FacilityID = new System.Windows.Forms.ComboBox(); this.CB_FacilityID = new System.Windows.Forms.ComboBox();
this.GB_FacilityMessage = new System.Windows.Forms.GroupBox(); this.GB_FacilityMessage = new System.Windows.Forms.GroupBox();
@ -56,10 +59,8 @@
this.NUD_FacilityColor = new System.Windows.Forms.NumericUpDown(); this.NUD_FacilityColor = new System.Windows.Forms.NumericUpDown();
this.L_FacilityColor = new System.Windows.Forms.Label(); this.L_FacilityColor = new System.Windows.Forms.Label();
this.L_FacilityType = 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_FacilityNPC = new System.Windows.Forms.ComboBox();
this.CB_FacilityType = 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_FestaStartDate = new System.Windows.Forms.DateTimePicker();
this.CAL_FestaStartTime = new System.Windows.Forms.DateTimePicker(); this.CAL_FestaStartTime = new System.Windows.Forms.DateTimePicker();
this.GB_FestaStartTime = new System.Windows.Forms.GroupBox(); this.GB_FestaStartTime = new System.Windows.Forms.GroupBox();
@ -78,10 +79,10 @@
((System.ComponentModel.ISupportInitialize)(this.NUD_FC_Used)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_FC_Used)).BeginInit();
this.GB_Phrase.SuspendLayout(); this.GB_Phrase.SuspendLayout();
this.GB_Facility.SuspendLayout(); this.GB_Facility.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_Exchangable)).BeginInit();
this.GB_FacilityMessage.SuspendLayout(); this.GB_FacilityMessage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityMessage)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityMessage)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityColor)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityColor)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityIndex)).BeginInit();
this.GB_FestaStartTime.SuspendLayout(); this.GB_FestaStartTime.SuspendLayout();
this.GB_Reward.SuspendLayout(); this.GB_Reward.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_Rank)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Rank)).BeginInit();
@ -248,8 +249,11 @@
// //
// GB_Facility // GB_Facility
// //
this.GB_Facility.Controls.Add(this.L_Exchangable);
this.GB_Facility.Controls.Add(this.NUD_Exchangable);
this.GB_Facility.Controls.Add(this.LB_FacilityIndex);
this.GB_Facility.Controls.Add(this.L_FacilityColorV); this.GB_Facility.Controls.Add(this.L_FacilityColorV);
this.GB_Facility.Controls.Add(this.L_VisitorMisc); this.GB_Facility.Controls.Add(this.L_OtherValue);
this.GB_Facility.Controls.Add(this.TB_FacilityID); this.GB_Facility.Controls.Add(this.TB_FacilityID);
this.GB_Facility.Controls.Add(this.CB_FacilityID); this.GB_Facility.Controls.Add(this.CB_FacilityID);
this.GB_Facility.Controls.Add(this.GB_FacilityMessage); this.GB_Facility.Controls.Add(this.GB_FacilityMessage);
@ -259,10 +263,8 @@
this.GB_Facility.Controls.Add(this.NUD_FacilityColor); this.GB_Facility.Controls.Add(this.NUD_FacilityColor);
this.GB_Facility.Controls.Add(this.L_FacilityColor); this.GB_Facility.Controls.Add(this.L_FacilityColor);
this.GB_Facility.Controls.Add(this.L_FacilityType); 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_FacilityNPC);
this.GB_Facility.Controls.Add(this.CB_FacilityType); 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.Controls.Add(this.TB_OTName);
this.GB_Facility.Location = new System.Drawing.Point(12, 269); this.GB_Facility.Location = new System.Drawing.Point(12, 269);
this.GB_Facility.Name = "GB_Facility"; this.GB_Facility.Name = "GB_Facility";
@ -271,43 +273,89 @@
this.GB_Facility.TabStop = false; this.GB_Facility.TabStop = false;
this.GB_Facility.Text = "Facilities"; this.GB_Facility.Text = "Facilities";
// //
// L_Exchangable
//
this.L_Exchangable.Location = new System.Drawing.Point(44, 137);
this.L_Exchangable.Name = "L_Exchangable";
this.L_Exchangable.Size = new System.Drawing.Size(123, 18);
this.L_Exchangable.TabIndex = 63;
this.L_Exchangable.Text = "exchange left count:";
this.L_Exchangable.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// NUD_Exchangable
//
this.NUD_Exchangable.Location = new System.Drawing.Point(173, 138);
this.NUD_Exchangable.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.NUD_Exchangable.Name = "NUD_Exchangable";
this.NUD_Exchangable.Size = new System.Drawing.Size(41, 19);
this.NUD_Exchangable.TabIndex = 62;
this.NUD_Exchangable.Value = new decimal(new int[] {
255,
0,
0,
0});
//
// LB_FacilityIndex
//
this.LB_FacilityIndex.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.LB_FacilityIndex.FormattingEnabled = true;
this.LB_FacilityIndex.ItemHeight = 19;
this.LB_FacilityIndex.Items.AddRange(new object[] {
"1",
"2",
"3",
"4",
"5",
"6",
"7"});
this.LB_FacilityIndex.Location = new System.Drawing.Point(9, 19);
this.LB_FacilityIndex.Name = "LB_FacilityIndex";
this.LB_FacilityIndex.Size = new System.Drawing.Size(26, 137);
this.LB_FacilityIndex.TabIndex = 61;
this.LB_FacilityIndex.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.LB_FacilityIndex_DrawItem);
this.LB_FacilityIndex.SelectedIndexChanged += new System.EventHandler(this.LB_FacilityIndex_SelectedIndexChanged);
//
// L_FacilityColorV // L_FacilityColorV
// //
this.L_FacilityColorV.Location = new System.Drawing.Point(122, 77); this.L_FacilityColorV.Location = new System.Drawing.Point(141, 73);
this.L_FacilityColorV.Name = "L_FacilityColorV"; this.L_FacilityColorV.Name = "L_FacilityColorV";
this.L_FacilityColorV.Size = new System.Drawing.Size(100, 18); this.L_FacilityColorV.Size = new System.Drawing.Size(100, 18);
this.L_FacilityColorV.TabIndex = 60; this.L_FacilityColorV.TabIndex = 60;
this.L_FacilityColorV.Text = "colorvalue"; this.L_FacilityColorV.Text = "colorvalue";
this.L_FacilityColorV.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.L_FacilityColorV.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
// //
// L_VisitorMisc // L_OtherValue
// //
this.L_VisitorMisc.Location = new System.Drawing.Point(282, 108); this.L_OtherValue.Location = new System.Drawing.Point(251, 108);
this.L_VisitorMisc.Name = "L_VisitorMisc"; this.L_OtherValue.Name = "L_OtherValue";
this.L_VisitorMisc.Size = new System.Drawing.Size(82, 18); this.L_OtherValue.Size = new System.Drawing.Size(82, 18);
this.L_VisitorMisc.TabIndex = 59; this.L_OtherValue.TabIndex = 59;
this.L_VisitorMisc.Text = "visitor misc:"; this.L_OtherValue.Text = "other value:";
this.L_VisitorMisc.TextAlign = System.Drawing.ContentAlignment.MiddleRight; this.L_OtherValue.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
// //
// TB_FacilityID // TB_FacilityID
// //
this.TB_FacilityID.Location = new System.Drawing.Point(169, 137); this.TB_FacilityID.Location = new System.Drawing.Point(243, 137);
this.TB_FacilityID.MaxLength = 32; this.TB_FacilityID.MaxLength = 24;
this.TB_FacilityID.Name = "TB_FacilityID"; this.TB_FacilityID.Name = "TB_FacilityID";
this.TB_FacilityID.Size = new System.Drawing.Size(277, 19); this.TB_FacilityID.Size = new System.Drawing.Size(203, 19);
this.TB_FacilityID.TabIndex = 0; this.TB_FacilityID.TabIndex = 0;
this.TB_FacilityID.Text = "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"; this.TB_FacilityID.Text = "CCCCCCCCCCCCCCCCCCCCCCCC";
this.TB_FacilityID.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; this.TB_FacilityID.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.TB_FacilityID.TextChanged += new System.EventHandler(this.TB_FacilityID_TextChanged); this.TB_FacilityID.TextChanged += new System.EventHandler(this.TB_FacilityID_TextChanged);
// //
// CB_FacilityID // CB_FacilityID
// //
this.CB_FacilityID.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.CB_FacilityID.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CB_FacilityID.DropDownWidth = 76; this.CB_FacilityID.DropDownWidth = 180;
this.CB_FacilityID.FormattingEnabled = true; this.CB_FacilityID.FormattingEnabled = true;
this.CB_FacilityID.Location = new System.Drawing.Point(370, 108); this.CB_FacilityID.Location = new System.Drawing.Point(339, 108);
this.CB_FacilityID.Name = "CB_FacilityID"; this.CB_FacilityID.Name = "CB_FacilityID";
this.CB_FacilityID.Size = new System.Drawing.Size(76, 20); this.CB_FacilityID.Size = new System.Drawing.Size(107, 20);
this.CB_FacilityID.TabIndex = 1; this.CB_FacilityID.TabIndex = 1;
this.CB_FacilityID.SelectedIndexChanged += new System.EventHandler(this.CB_FacilityID_SelectedIndexChanged); this.CB_FacilityID.SelectedIndexChanged += new System.EventHandler(this.CB_FacilityID_SelectedIndexChanged);
// //
@ -380,7 +428,7 @@
// //
// L_FacilityNPC // L_FacilityNPC
// //
this.L_FacilityNPC.Location = new System.Drawing.Point(27, 103); this.L_FacilityNPC.Location = new System.Drawing.Point(46, 99);
this.L_FacilityNPC.Name = "L_FacilityNPC"; this.L_FacilityNPC.Name = "L_FacilityNPC";
this.L_FacilityNPC.Size = new System.Drawing.Size(45, 18); this.L_FacilityNPC.Size = new System.Drawing.Size(45, 18);
this.L_FacilityNPC.TabIndex = 8; this.L_FacilityNPC.TabIndex = 8;
@ -389,7 +437,7 @@
// //
// NUD_FacilityColor // NUD_FacilityColor
// //
this.NUD_FacilityColor.Location = new System.Drawing.Point(78, 78); this.NUD_FacilityColor.Location = new System.Drawing.Point(97, 74);
this.NUD_FacilityColor.Maximum = new decimal(new int[] { this.NUD_FacilityColor.Maximum = new decimal(new int[] {
7, 7,
0, 0,
@ -407,7 +455,7 @@
// //
// L_FacilityColor // L_FacilityColor
// //
this.L_FacilityColor.Location = new System.Drawing.Point(25, 77); this.L_FacilityColor.Location = new System.Drawing.Point(44, 73);
this.L_FacilityColor.Name = "L_FacilityColor"; this.L_FacilityColor.Name = "L_FacilityColor";
this.L_FacilityColor.Size = new System.Drawing.Size(47, 18); this.L_FacilityColor.Size = new System.Drawing.Size(47, 18);
this.L_FacilityColor.TabIndex = 6; this.L_FacilityColor.TabIndex = 6;
@ -416,28 +464,19 @@
// //
// L_FacilityType // L_FacilityType
// //
this.L_FacilityType.Location = new System.Drawing.Point(28, 52); this.L_FacilityType.Location = new System.Drawing.Point(47, 48);
this.L_FacilityType.Name = "L_FacilityType"; this.L_FacilityType.Name = "L_FacilityType";
this.L_FacilityType.Size = new System.Drawing.Size(44, 18); this.L_FacilityType.Size = new System.Drawing.Size(44, 18);
this.L_FacilityType.TabIndex = 5; this.L_FacilityType.TabIndex = 5;
this.L_FacilityType.Text = "type:"; this.L_FacilityType.Text = "type:";
this.L_FacilityType.TextAlign = System.Drawing.ContentAlignment.MiddleRight; 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 // CB_FacilityNPC
// //
this.CB_FacilityNPC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.CB_FacilityNPC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CB_FacilityNPC.DropDownWidth = 120; this.CB_FacilityNPC.DropDownWidth = 120;
this.CB_FacilityNPC.FormattingEnabled = true; this.CB_FacilityNPC.FormattingEnabled = true;
this.CB_FacilityNPC.Location = new System.Drawing.Point(78, 103); this.CB_FacilityNPC.Location = new System.Drawing.Point(97, 99);
this.CB_FacilityNPC.Name = "CB_FacilityNPC"; this.CB_FacilityNPC.Name = "CB_FacilityNPC";
this.CB_FacilityNPC.Size = new System.Drawing.Size(123, 20); this.CB_FacilityNPC.Size = new System.Drawing.Size(123, 20);
this.CB_FacilityNPC.TabIndex = 2; this.CB_FacilityNPC.TabIndex = 2;
@ -447,30 +486,12 @@
this.CB_FacilityType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.CB_FacilityType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CB_FacilityType.DropDownWidth = 180; this.CB_FacilityType.DropDownWidth = 180;
this.CB_FacilityType.FormattingEnabled = true; this.CB_FacilityType.FormattingEnabled = true;
this.CB_FacilityType.Location = new System.Drawing.Point(78, 52); this.CB_FacilityType.Location = new System.Drawing.Point(97, 48);
this.CB_FacilityType.Name = "CB_FacilityType"; this.CB_FacilityType.Name = "CB_FacilityType";
this.CB_FacilityType.Size = new System.Drawing.Size(124, 20); this.CB_FacilityType.Size = new System.Drawing.Size(124, 20);
this.CB_FacilityType.TabIndex = 1; this.CB_FacilityType.TabIndex = 1;
this.CB_FacilityType.SelectedIndexChanged += new System.EventHandler(this.CB_FacilityType_SelectedIndexChanged); 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 // CAL_FestaStartDate
// //
this.CAL_FestaStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; this.CAL_FestaStartDate.Format = System.Windows.Forms.DateTimePickerFormat.Short;
@ -662,10 +683,10 @@
this.GB_Phrase.ResumeLayout(false); this.GB_Phrase.ResumeLayout(false);
this.GB_Facility.ResumeLayout(false); this.GB_Facility.ResumeLayout(false);
this.GB_Facility.PerformLayout(); this.GB_Facility.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.NUD_Exchangable)).EndInit();
this.GB_FacilityMessage.ResumeLayout(false); this.GB_FacilityMessage.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityMessage)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityMessage)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityColor)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityColor)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_FacilityIndex)).EndInit();
this.GB_FestaStartTime.ResumeLayout(false); this.GB_FestaStartTime.ResumeLayout(false);
this.GB_Reward.ResumeLayout(false); this.GB_Reward.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.NUD_Rank)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.NUD_Rank)).EndInit();
@ -698,13 +719,11 @@
private System.Windows.Forms.CheckedListBox CLB_Reward; private System.Windows.Forms.CheckedListBox CLB_Reward;
private System.Windows.Forms.Button B_AllReceiveReward; private System.Windows.Forms.Button B_AllReceiveReward;
private System.Windows.Forms.Button B_AllReadyReward; 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.CheckBox CHK_FacilityIntroduced;
private System.Windows.Forms.Label L_FacilityNPC; private System.Windows.Forms.Label L_FacilityNPC;
private System.Windows.Forms.NumericUpDown NUD_FacilityColor; private System.Windows.Forms.NumericUpDown NUD_FacilityColor;
private System.Windows.Forms.Label L_FacilityColor; private System.Windows.Forms.Label L_FacilityColor;
private System.Windows.Forms.Label L_FacilityType; 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_FacilityNPC;
private System.Windows.Forms.ComboBox CB_FacilityType; private System.Windows.Forms.ComboBox CB_FacilityType;
private System.Windows.Forms.Label Label_OTGender; private System.Windows.Forms.Label Label_OTGender;
@ -715,11 +734,14 @@
private System.Windows.Forms.TextBox TB_FacilityID; private System.Windows.Forms.TextBox TB_FacilityID;
private System.Windows.Forms.NumericUpDown NUD_Rank; private System.Windows.Forms.NumericUpDown NUD_Rank;
private System.Windows.Forms.Label L_Rank; private System.Windows.Forms.Label L_Rank;
private System.Windows.Forms.Label L_VisitorMisc; private System.Windows.Forms.Label L_OtherValue;
private System.Windows.Forms.GroupBox GB_MyMessage; private System.Windows.Forms.GroupBox GB_MyMessage;
private System.Windows.Forms.NumericUpDown NUD_MyMessage; private System.Windows.Forms.NumericUpDown NUD_MyMessage;
private System.Windows.Forms.ComboBox CB_MyMessage; private System.Windows.Forms.ComboBox CB_MyMessage;
private System.Windows.Forms.Label L_FacilityColorV; private System.Windows.Forms.Label L_FacilityColorV;
private System.Windows.Forms.Label L_Note; private System.Windows.Forms.Label L_Note;
private System.Windows.Forms.ListBox LB_FacilityIndex;
private System.Windows.Forms.NumericUpDown NUD_Exchangable;
private System.Windows.Forms.Label L_Exchangable;
} }
} }

View file

@ -77,7 +77,7 @@ namespace PKHeX.WinForms
CB_FacilityMessage.Items.AddRange(res3); CB_FacilityMessage.Items.AddRange(res3);
CB_MyMessage.Items.Clear(); CB_MyMessage.Items.Clear();
CB_MyMessage.Items.AddRange(res3); CB_MyMessage.Items.AddRange(res3);
string[] res4 = { "misc1", "misc2", "FestaID" }; string[] res4 = { "Used Flags", "Used Stat (Random Value)", "FestaID" };
CB_FacilityID.Items.Clear(); CB_FacilityID.Items.Clear();
CB_FacilityID.Items.AddRange(res4); 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" }; string[] res5 = { "Ace Trainer", "Ace Trainer", "Veteran", "Veteran", "Office Worker", "Office Worker", "Punk Guy", "Punk Girl", "Breeder", "Breeder", "Youngster", "Lass" };
@ -126,7 +126,7 @@ namespace PKHeX.WinForms
NUD_Rank.Value = SAV.FestaRank; NUD_Rank.Value = SAV.FestaRank;
CB_MyMessage.SelectedIndex = 0; CB_MyMessage.SelectedIndex = 0;
LoadMyMessage(0); LoadMyMessage(0);
NUD_FacilityIndex.Value = 0; LB_FacilityIndex.SelectedIndex = 0;
CB_FacilityMessage.SelectedIndex = 0; CB_FacilityMessage.SelectedIndex = 0;
CB_FacilityID.SelectedIndex = 0; CB_FacilityID.SelectedIndex = 0;
editing = false; editing = false;
@ -147,7 +147,7 @@ namespace PKHeX.WinForms
new byte[]{6,7,0,3},//Food new byte[]{6,7,0,3},//Food
new byte[]{4,5,8,3},//Bouncy new byte[]{4,5,8,3},//Bouncy
new byte[]{0,1,2,3},//Fortune new byte[]{0,1,2,3},//Fortune
new byte[]{0,7,8,4,5,2,9,10},//Dye new byte[]{0,7,8,4,5,1,9,10},//Dye
new byte[]{11,1,5,3},//Exchange new byte[]{11,1,5,3},//Exchange
}; };
private readonly byte[][] RES_FacilityLevelType = //3:123 4:135 5:12345 private readonly byte[][] RES_FacilityLevelType = //3:123 4:135 5:12345
@ -191,6 +191,8 @@ namespace PKHeX.WinForms
NUD_FacilityColor.Maximum = getColorCount(type); NUD_FacilityColor.Maximum = getColorCount(type);
NUD_FacilityColor.Value = Math.Min(facility.Color, NUD_FacilityColor.Maximum); NUD_FacilityColor.Value = Math.Min(facility.Color, NUD_FacilityColor.Maximum);
if (type >= 0) LoadColorLabel(type); if (type >= 0) LoadColorLabel(type);
NUD_Exchangable.Enabled = NUD_Exchangable.Visible = L_Exchangable.Visible = type == 7;
if (type == 7) NUD_Exchangable.Value = facility.ExchangeLeftCount;
CB_FacilityNPC.SelectedIndex = CB_FacilityNPC.SelectedIndex =
CB_FacilityNPC.Items.Count > facility.NPC CB_FacilityNPC.Items.Count > facility.NPC
? facility.NPC ? facility.NPC
@ -274,18 +276,19 @@ namespace PKHeX.WinForms
} }
private void Label_OTGender_Click(object sender, EventArgs e) private void Label_OTGender_Click(object sender, EventArgs e)
{ {
int fIndex = (int)NUD_FacilityIndex.Value; if (entry < 0) return;
var b = f[fIndex].Gender; var b = f[entry].Gender;
b ^= 1; b ^= 1;
f[fIndex].Gender = b; f[entry].Gender = b;
LoadOTlabel(b); LoadOTlabel(b);
} }
private void LoadFMessage(int fmIndex) => NUD_FacilityMessage.Value = f[(int)NUD_FacilityIndex.Value].GetMessage(fmIndex); private void LoadFMessage(int fmIndex) => NUD_FacilityMessage.Value = f[entry].GetMessage(fmIndex);
private void CB_FacilityMessage_SelectedIndexChanged(object sender, EventArgs e) private void CB_FacilityMessage_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (editing) return; if (editing) return;
int fmIndex = CB_FacilityMessage.SelectedIndex; int fmIndex = CB_FacilityMessage.SelectedIndex;
if (fmIndex < 0) return; if (fmIndex < 0) return;
if (entry < 0) return;
editing = true; editing = true;
LoadFMessage(fmIndex); LoadFMessage(fmIndex);
editing = false; editing = false;
@ -296,17 +299,18 @@ namespace PKHeX.WinForms
if (editing) return; if (editing) return;
int fmIndex = CB_FacilityMessage.SelectedIndex; int fmIndex = CB_FacilityMessage.SelectedIndex;
if (fmIndex < 0) return; if (fmIndex < 0) return;
f[(int)NUD_FacilityIndex.Value].SetMessage(fmIndex, (ushort)NUD_FacilityMessage.Value); if (entry < 0) return;
f[entry].SetMessage(fmIndex, (ushort)NUD_FacilityMessage.Value);
} }
private void LoadFestID(int m) private void LoadFestID(int m)
{ {
int fIndex = (int)NUD_FacilityIndex.Value; if (entry < 0) return;
switch (m) switch (m)
{ {
case 0: TB_FacilityID.Text = f[fIndex].Misc1.ToString("X8"); break; case 0: TB_FacilityID.Text = f[entry].UsedFlags.ToString("X8"); break;
case 1: TB_FacilityID.Text = f[fIndex].Misc2.ToString("X8"); break; case 1: TB_FacilityID.Text = f[entry].UsedRandStat.ToString("X8"); break;
case 2: case 2:
var bytes = f[fIndex].TrainerFesID; var bytes = f[entry].TrainerFesID;
var str = BitConverter.ToString(bytes).Replace("-", string.Empty); var str = BitConverter.ToString(bytes).Replace("-", string.Empty);
TB_FacilityID.Text = str; TB_FacilityID.Text = str;
break; break;
@ -326,7 +330,7 @@ namespace PKHeX.WinForms
private void TB_FacilityID_TextChanged(object sender, EventArgs e) private void TB_FacilityID_TextChanged(object sender, EventArgs e)
{ {
if (editing) return; if (editing) return;
int fIndex = (int)NUD_FacilityIndex.Value; if (entry < 0) return;
int fiIndex = CB_FacilityID.SelectedIndex; int fiIndex = CB_FacilityID.SelectedIndex;
string t = Util.GetOnlyHex(TB_FacilityID.Text); string t = Util.GetOnlyHex(TB_FacilityID.Text);
int maxlen = fiIndex == 2 ? 12 << 1 : 4 << 1; int maxlen = fiIndex == 2 ? 12 << 1 : 4 << 1;
@ -340,14 +344,14 @@ namespace PKHeX.WinForms
} }
switch (fiIndex) switch (fiIndex)
{ {
case 0: f[fIndex].Misc1 = Convert.ToUInt32(t, 16); break; case 0: f[entry].UsedFlags = Convert.ToUInt32(t, 16); break;
case 1: f[fIndex].Misc2 = Convert.ToUInt32(t, 16); break; case 1: f[entry].UsedRandStat = Convert.ToUInt32(t, 16); break;
case 2: case 2:
if (t.Length != 12 * 2) if (t.Length != 12 * 2)
t = t.PadLeft(24, '0'); t = t.PadLeft(24, '0');
var bytes = t.ToByteArray(); var bytes = t.ToByteArray();
Array.Resize(ref bytes, 12); Array.Resize(ref bytes, 12);
f[fIndex].TrainerFesID = bytes; f[entry].TrainerFesID = bytes;
break; break;
} }
} }
@ -355,7 +359,8 @@ namespace PKHeX.WinForms
private void NUD_FacilityColor_ValueChanged(object sender, EventArgs e) private void NUD_FacilityColor_ValueChanged(object sender, EventArgs e)
{ {
if (editing) return; if (editing) return;
f[(int)NUD_FacilityIndex.Value].Color = (byte)NUD_FacilityColor.Value; if (entry < 0) return;
f[entry].Color = (byte)NUD_FacilityColor.Value;
int type = TypeIndexToType(CB_FacilityType.SelectedIndex); int type = TypeIndexToType(CB_FacilityType.SelectedIndex);
if (type < 0) return; if (type < 0) return;
editing = true; editing = true;
@ -366,30 +371,25 @@ namespace PKHeX.WinForms
private void CB_FacilityType_SelectedIndexChanged(object sender, EventArgs e) private void CB_FacilityType_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (editing) return; if (editing) return;
int fIndex = (int)NUD_FacilityIndex.Value; if (entry < 0) return;
int typeIndex = CB_FacilityType.SelectedIndex; int typeIndex = CB_FacilityType.SelectedIndex;
if (typeIndex < 0) return; if (typeIndex < 0) return;
f[fIndex].Type = (byte)typeIndex; f[entry].Type = (byte)typeIndex;
int type = TypeIndexToType(typeIndex); int type = TypeIndexToType(typeIndex);
int colorCount = getColorCount(type); int colorCount = getColorCount(type);
editing = true; editing = true;
if (colorCount < NUD_FacilityColor.Value) if (colorCount < NUD_FacilityColor.Value)
{ {
NUD_FacilityColor.Value = colorCount; NUD_FacilityColor.Value = colorCount;
f[fIndex].Color = (byte)colorCount; f[entry].Color = (byte)colorCount;
} }
NUD_FacilityColor.Maximum = colorCount; NUD_FacilityColor.Maximum = colorCount;
LoadColorLabel(type); LoadColorLabel(type);
NUD_Exchangable.Enabled = NUD_Exchangable.Visible = L_Exchangable.Visible = type == 7;
if (type == 7) NUD_Exchangable.Value = f[entry].ExchangeLeftCount;
editing = false; editing = false;
} }
private void NUD_FacilityIndex_ValueChanged(object sender, EventArgs e)
{
if (editing) return;
SaveFacility();
entry = (int) NUD_FacilityIndex.Value;
LoadFacility();
}
private void SaveFacility() private void SaveFacility()
{ {
if (entry < 0) if (entry < 0)
@ -400,6 +400,7 @@ namespace PKHeX.WinForms
facility.OT_Name = TB_OTName.Text; facility.OT_Name = TB_OTName.Text;
facility.NPC = CB_FacilityNPC.SelectedIndex; facility.NPC = CB_FacilityNPC.SelectedIndex;
facility.IsIntroduced = CHK_FacilityIntroduced.Checked; facility.IsIntroduced = CHK_FacilityIntroduced.Checked;
facility.ExchangeLeftCount = (byte)(TypeIndexToType(facility.Type) == 7 ? NUD_Exchangable.Value : 0);
} }
private void NUD_Rank_ValueChanged(object sender, EventArgs e) private void NUD_Rank_ValueChanged(object sender, EventArgs e)
@ -429,24 +430,41 @@ namespace PKHeX.WinForms
private void CHK_FacilityIntroduced_CheckedChanged(object sender, EventArgs e) private void CHK_FacilityIntroduced_CheckedChanged(object sender, EventArgs e)
{ {
if (editing) return; if (editing) return;
int fIndex = (int)NUD_FacilityIndex.Value; if (entry < 0) return;
f[fIndex].IsIntroduced = CHK_FacilityIntroduced.Checked; f[entry].IsIntroduced = CHK_FacilityIntroduced.Checked;
if (!L_Note.Visible && !f[fIndex].IsIntroduced && ( if (!L_Note.Visible && !f[entry].IsIntroduced && (
f[fIndex].OT_Name.Length > 0 f[entry].OT_Name.Length > 0
|| f[fIndex].GetMessage(0) != 0 || f[entry].GetMessage(0) != 0
|| f[fIndex].GetMessage(1) != 0 || f[entry].GetMessage(1) != 0
|| f[fIndex].GetMessage(2) != 0 || f[entry].GetMessage(2) != 0
|| f[fIndex].GetMessage(3) != 0 || f[entry].GetMessage(3) != 0
|| f[fIndex].Misc1 != 0 || f[entry].UsedFlags != 0
|| f[fIndex].Misc2 != 0 || f[entry].UsedRandStat != 0
|| f[fIndex].TrainerFesID.Any(v => v != 0) || f[entry].TrainerFesID.Any(v => v != 0)
)) L_Note.Visible = true; )) L_Note.Visible = true;
} }
private void TB_OTName_TextChanged(object sender, EventArgs e) private void TB_OTName_TextChanged(object sender, EventArgs e)
{ {
if (editing) return; if (editing) return;
f[(int)NUD_FacilityIndex.Value].OT_Name = TB_OTName.Text; if (entry < 0) return;
f[entry].OT_Name = TB_OTName.Text;
}
private void LB_FacilityIndex_SelectedIndexChanged(object sender, EventArgs e)
{
if (editing) return;
SaveFacility();
entry = LB_FacilityIndex.SelectedIndex;
if (entry < 0) return;
LoadFacility();
}
private void LB_FacilityIndex_DrawItem(object sender, DrawItemEventArgs e)
{
e.DrawBackground();
e.Graphics.DrawString(((ListBox)sender).Items[e.Index].ToString(), e.Font, new SolidBrush(e.ForeColor), new RectangleF(e.Bounds.X, e.Bounds.Y + (e.Bounds.Height - 12 >> 1), e.Bounds.Width, 12));
e.DrawFocusRectangle();
} }
} }
public class FestaFacility public class FestaFacility
@ -466,11 +484,12 @@ namespace PKHeX.WinForms
private int MessageMoved { get => BitConverter.ToUInt16(Data, 0x22); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x22); } private int MessageMoved { get => BitConverter.ToUInt16(Data, 0x22); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x22); }
private int MessageDisappointed { get => BitConverter.ToUInt16(Data, 0x24); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x24); } private int MessageDisappointed { get => BitConverter.ToUInt16(Data, 0x24); set => BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x24); }
public uint Misc1 { get => BitConverter.ToUInt32(Data, 0x28); set => BitConverter.GetBytes(value).CopyTo(Data, 0x28); } public uint UsedFlags { get => BitConverter.ToUInt32(Data, 0x28); set => BitConverter.GetBytes(value).CopyTo(Data, 0x28); }
public uint Misc2 { get => BitConverter.ToUInt32(Data, 0x2C); set => BitConverter.GetBytes(value).CopyTo(Data, 0x2C); } public uint UsedRandStat { get => BitConverter.ToUInt32(Data, 0x2C); set => BitConverter.GetBytes(value).CopyTo(Data, 0x2C); }
public int NPC { get => Math.Max(0, BitConverter.ToInt32(Data, 0x30)); set => BitConverter.GetBytes(Math.Max(0, value)).CopyTo(Data, 0x30); } public int NPC { get => Math.Max(0, BitConverter.ToInt32(Data, 0x30)); set => BitConverter.GetBytes(Math.Max(0, value)).CopyTo(Data, 0x30); }
public byte[] TrainerFesID { get => Data.Skip(0x34).Take(12).ToArray(); set => value.CopyTo(Data, 0x34); } public byte[] TrainerFesID { get => Data.Skip(0x34).Take(12).ToArray(); set => value.CopyTo(Data, 0x34); }
public byte ExchangeLeftCount { get => Data[0x40]; set => Data[0x40] = value; } //over 9 shows "?"
private readonly int ofs; private readonly int ofs;
public FestaFacility(SAV7 sav, int index) public FestaFacility(SAV7 sav, int index)
{ {
@ -483,9 +502,7 @@ namespace PKHeX.WinForms
if (!IsIntroduced) if (!IsIntroduced)
{ {
// clear // clear
byte[] fid = new byte[0x40 - 2]; new byte[36].CopyTo(Data, 2);
BitConverter.GetBytes(NPC).CopyTo(fid, 0x30);
fid.CopyTo(Data, 2);
} }
sav.SetData(Data, ofs); sav.SetData(Data, ofs);
} }