add G7 MapUnmask & FlyDestination

G7 is not FLY, just consistency with other Gens.
This commit is contained in:
pokecal 2017-11-14 11:59:29 +09:00
parent 97a159c710
commit 955833a1c6
2 changed files with 159 additions and 3 deletions

View file

@ -1,4 +1,4 @@
namespace PKHeX.WinForms
namespace PKHeX.WinForms
{
partial class SAV_Trainer7
{
@ -193,6 +193,12 @@ namespace PKHeX.WinForms
this.L_ThumbsTotal = new System.Windows.Forms.Label();
this.B_Fashion = new System.Windows.Forms.Button();
this.CHK_UnlockZMove = new System.Windows.Forms.CheckBox();
this.GB_FlyDest = new System.Windows.Forms.GroupBox();
this.B_AllFlyDest = new System.Windows.Forms.Button();
this.CLB_FlyDest = new System.Windows.Forms.CheckedListBox();
this.GB_MapUnmask = new System.Windows.Forms.GroupBox();
this.B_AllMapUnmask = new System.Windows.Forms.Button();
this.CLB_MapUnmask = new System.Windows.Forms.CheckedListBox();
this.TC_Editor.SuspendLayout();
this.Tab_Overview.SuspendLayout();
this.GB_Stats.SuspendLayout();
@ -227,6 +233,8 @@ namespace PKHeX.WinForms
((System.ComponentModel.ISupportInitialize)(this.NUD_SnapCount)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_ThumbsRecord)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_ThumbsTotal)).BeginInit();
this.GB_FlyDest.SuspendLayout();
this.GB_MapUnmask.SuspendLayout();
this.SuspendLayout();
//
// B_Cancel
@ -1150,6 +1158,8 @@ namespace PKHeX.WinForms
//
// Tab_BadgeMap
//
this.Tab_BadgeMap.Controls.Add(this.GB_MapUnmask);
this.Tab_BadgeMap.Controls.Add(this.GB_FlyDest);
this.Tab_BadgeMap.Controls.Add(this.GB_Map);
this.Tab_BadgeMap.Location = new System.Drawing.Point(4, 22);
this.Tab_BadgeMap.Name = "Tab_BadgeMap";
@ -1170,7 +1180,7 @@ namespace PKHeX.WinForms
this.GB_Map.Controls.Add(this.L_CurrentMap);
this.GB_Map.Controls.Add(this.L_Z);
this.GB_Map.Controls.Add(this.L_X);
this.GB_Map.Location = new System.Drawing.Point(115, 64);
this.GB_Map.Location = new System.Drawing.Point(6, 6);
this.GB_Map.Name = "GB_Map";
this.GB_Map.Size = new System.Drawing.Size(203, 156);
this.GB_Map.TabIndex = 58;
@ -2002,6 +2012,66 @@ namespace PKHeX.WinForms
this.CHK_UnlockZMove.Text = "Unlock Z Moves";
this.CHK_UnlockZMove.UseVisualStyleBackColor = true;
//
// GB_FlyDest
//
this.GB_FlyDest.Controls.Add(this.B_AllFlyDest);
this.GB_FlyDest.Controls.Add(this.CLB_FlyDest);
this.GB_FlyDest.Location = new System.Drawing.Point(218, 6);
this.GB_FlyDest.Name = "GB_FlyDest";
this.GB_FlyDest.Size = new System.Drawing.Size(140, 138);
this.GB_FlyDest.TabIndex = 59;
this.GB_FlyDest.TabStop = false;
this.GB_FlyDest.Text = "Fly Destination";
//
// B_AllFlyDest
//
this.B_AllFlyDest.Location = new System.Drawing.Point(5, 21);
this.B_AllFlyDest.Name = "B_AllFlyDest";
this.B_AllFlyDest.Size = new System.Drawing.Size(75, 25);
this.B_AllFlyDest.TabIndex = 0;
this.B_AllFlyDest.Text = "Check All";
this.B_AllFlyDest.UseVisualStyleBackColor = true;
this.B_AllFlyDest.Click += new System.EventHandler(this.B_AllFlyDest_Click);
//
// CLB_FlyDest
//
this.CLB_FlyDest.CheckOnClick = true;
this.CLB_FlyDest.FormattingEnabled = true;
this.CLB_FlyDest.Location = new System.Drawing.Point(6, 54);
this.CLB_FlyDest.Name = "CLB_FlyDest";
this.CLB_FlyDest.Size = new System.Drawing.Size(128, 79);
this.CLB_FlyDest.TabIndex = 1;
//
// GB_MapUnmask
//
this.GB_MapUnmask.Controls.Add(this.B_AllMapUnmask);
this.GB_MapUnmask.Controls.Add(this.CLB_MapUnmask);
this.GB_MapUnmask.Location = new System.Drawing.Point(218, 150);
this.GB_MapUnmask.Name = "GB_MapUnmask";
this.GB_MapUnmask.Size = new System.Drawing.Size(140, 138);
this.GB_MapUnmask.TabIndex = 60;
this.GB_MapUnmask.TabStop = false;
this.GB_MapUnmask.Text = "Map Unmask";
//
// B_AllMapUnmask
//
this.B_AllMapUnmask.Location = new System.Drawing.Point(5, 21);
this.B_AllMapUnmask.Name = "B_AllMapUnmask";
this.B_AllMapUnmask.Size = new System.Drawing.Size(75, 25);
this.B_AllMapUnmask.TabIndex = 0;
this.B_AllMapUnmask.Text = "Check All";
this.B_AllMapUnmask.UseVisualStyleBackColor = true;
this.B_AllMapUnmask.Click += new System.EventHandler(this.B_AllMapUnmask_Click);
//
// CLB_MapUnmask
//
this.CLB_MapUnmask.CheckOnClick = true;
this.CLB_MapUnmask.FormattingEnabled = true;
this.CLB_MapUnmask.Location = new System.Drawing.Point(6, 54);
this.CLB_MapUnmask.Name = "CLB_MapUnmask";
this.CLB_MapUnmask.Size = new System.Drawing.Size(128, 79);
this.CLB_MapUnmask.TabIndex = 1;
//
// SAV_Trainer7
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -2057,6 +2127,8 @@ namespace PKHeX.WinForms
((System.ComponentModel.ISupportInitialize)(this.NUD_SnapCount)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_ThumbsRecord)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.NUD_ThumbsTotal)).EndInit();
this.GB_FlyDest.ResumeLayout(false);
this.GB_MapUnmask.ResumeLayout(false);
this.ResumeLayout(false);
}
@ -2227,5 +2299,11 @@ namespace PKHeX.WinForms
private System.Windows.Forms.CheckBox CHK_UnlockSuperSingles;
private System.Windows.Forms.CheckBox CHK_UnlockMega;
private System.Windows.Forms.CheckBox CHK_UnlockZMove;
private System.Windows.Forms.GroupBox GB_MapUnmask;
private System.Windows.Forms.Button B_AllMapUnmask;
private System.Windows.Forms.CheckedListBox CLB_MapUnmask;
private System.Windows.Forms.GroupBox GB_FlyDest;
private System.Windows.Forms.Button B_AllFlyDest;
private System.Windows.Forms.CheckedListBox CLB_FlyDest;
}
}
}

View file

@ -48,6 +48,8 @@ namespace PKHeX.WinForms
private static readonly string[] TrainerStampTitle = { "01:Official Pokemon Trainer", "02:Melemele Trial Completion", "03:Akala Trial Completion", "04:Ula'ula Trial Completion", "05:Poni Trial Completion", "06:Island Challenge Completion", "07:Melemele Pokedex Completion", "08:Akala Pokedex Completion", "09:Ula'ula Pokedex Completion", "10:Poni Pokedex Completion", "11:Alola Pokedex Completion", "12:50 Consecutive Single Battle Wins", "13:50 Consecutive Double Battle Wins", "14:50 Consecutive Multi Battle Wins", "15:Poke Finder Pro" };
private static readonly string[] BattleStyles = { "Normal", "Elegant", "Girlish", "Reverent", "Smug", "Left-handed", "Passionate", "Idol" };
private int[] FlyDestFlagOfs, MapUnmaskFlagOfs;
private int skipFlag => SAV.USUM ? 4160 : 3200; // FlagMax - 768
private void GetComboBoxes()
{
@ -234,6 +236,67 @@ namespace PKHeX.WinForms
CHK_UnlockMega.Checked = SAV.MegaUnlocked;
CHK_UnlockZMove.Checked = SAV.ZMoveUnlocked;
System.Collections.Generic.List<ComboItem> metLocationList = GameInfo.GetLocationList(GameVersion.US, 7, false);
int[] FlyDestNameIndex = new[] {
-1,24,34,8,20,38,12,46,40,30,//Melemele
70,68,78,86,74,104,82,58,90,72,76,92,62,//Akala
132,136,138,114,118,144,130,154,140,//Ula'ula
172,184,180,174,176,156,186,//Poni
188,-1,-1,
198,202,110,204,//Beach
};
if (SAV.Version == GameVersion.UM || SAV.Version == GameVersion.MN)
{
FlyDestNameIndex[28] = 142;
FlyDestNameIndex[36] = 178;
}
FlyDestFlagOfs = new[] {
44,43,45,40,41,49,42,47,46,48,
50,54,39,57,51,55,59,52,58,53,61,60,56,
62,66,67,64,65,273,270,37,38,
69,74,72,71,276,73,70,
75,332,334,
331,333,335,336,
};
string[] FlyDestAltName = { "My House", "Photo Club(Hau'oli)", "Photo Club(Konikoni)", };
CLB_FlyDest.Items.Clear();
for (int i = 0, u = 0, m = FlyDestNameIndex.Length - (SAV.USUM ? 0 : 6); i < m; i++)
{
CLB_FlyDest.Items.Add(
FlyDestNameIndex[i] < 0
? FlyDestAltName[u++]
: metLocationList.First(v => v.Value == FlyDestNameIndex[i]).Text
, SAV.GetEventFlag(skipFlag + FlyDestFlagOfs[i])
);
}
int[] MapUnmaskNameIndex = new[] {
6,8,24,-1,18,-1,20,22,12,10,14,
70,50,68,52,74,54,56,58,60,72,62,64,
132,192,106,108,122,112,114,126,116,118,120,154,
172,158,160,162,164,166,168,170,
188,
198,202,110,204,
};
MapUnmaskFlagOfs = new[] {
5,76,82,91,79,84,80,81,77,78,83,
19,10,18,11,21,12,13,14,15,20,16,17,
33,34,30,31,98,92,93,94,95,96,97,141,
173,144,145,146,147,148,149,172,
181,
409,297,32,296,
};
string[] MapUnmaskAltName = { "Melemele Sea(East)", "Melemele Sea(West)", };
CLB_MapUnmask.Items.Clear();
for (int i = 0, u = 0, m = MapUnmaskNameIndex.Length - (SAV.USUM ? 0 : 4); i < m; i++)
{
CLB_MapUnmask.Items.Add(
MapUnmaskNameIndex[i] < 0
? MapUnmaskAltName[u++]
: metLocationList.First(v => v.Value == MapUnmaskNameIndex[i]).Text
, SAV.GetEventFlag(skipFlag + MapUnmaskFlagOfs[i])
);
}
}
private void Save()
{
@ -339,6 +402,11 @@ namespace PKHeX.WinForms
SAV.MegaUnlocked = CHK_UnlockMega.Checked;
SAV.ZMoveUnlocked = CHK_UnlockZMove.Checked;
for (int i = 0; i < CLB_FlyDest.Items.Count; i++)
SAV.SetEventFlag(skipFlag + FlyDestFlagOfs[i], CLB_FlyDest.GetItemChecked(i));
for (int i = 0; i < CLB_MapUnmask.Items.Count; i++)
SAV.SetEventFlag(skipFlag + MapUnmaskFlagOfs[i], CLB_MapUnmask.GetItemChecked(i));
}
private static uint GetBits(ListBox listbox)
{
@ -537,6 +605,16 @@ namespace PKHeX.WinForms
LB_BallThrowTypeUnlocked.SetSelected(i, true);
}
}
private void B_AllFlyDest_Click(object sender, EventArgs e)
{
for (int i = 0; i < CLB_FlyDest.Items.Count; i++)
CLB_FlyDest.SetItemChecked(i, true);
}
private void B_AllMapUnmask_Click(object sender, EventArgs e)
{
for (int i = 0; i < CLB_MapUnmask.Items.Count; i++)
CLB_MapUnmask.SetItemChecked(i, true);
}
private void B_GenTID_Click(object sender, EventArgs e)
{