Add default/illegal fashion payloads

User selects which payload they want to apply
closes #780
This commit is contained in:
Kurt 2017-01-30 18:32:18 -08:00
parent 1454433483
commit 26925ad528
7 changed files with 163 additions and 21 deletions

View file

@ -170,6 +170,7 @@ namespace PKHeX.WinForms
this.NUD_ThumbsTotal = new System.Windows.Forms.NumericUpDown();
this.L_ThumbsTotal = new System.Windows.Forms.Label();
this.B_Fashion = new System.Windows.Forms.Button();
this.CB_Fashion = new System.Windows.Forms.ComboBox();
this.TC_Editor.SuspendLayout();
this.Tab_Overview.SuspendLayout();
this.GB_Stats.SuspendLayout();
@ -1548,6 +1549,7 @@ namespace PKHeX.WinForms
//
// Tab_Misc
//
this.Tab_Misc.Controls.Add(this.CB_Fashion);
this.Tab_Misc.Controls.Add(this.L_SkinColor);
this.Tab_Misc.Controls.Add(this.CB_SkinColor);
this.Tab_Misc.Controls.Add(this.GB_PokeFinder);
@ -1717,6 +1719,19 @@ namespace PKHeX.WinForms
this.B_Fashion.UseVisualStyleBackColor = true;
this.B_Fashion.Click += new System.EventHandler(this.B_Fashion_Click);
//
// CB_Fashion
//
this.CB_Fashion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CB_Fashion.FormattingEnabled = true;
this.CB_Fashion.Items.AddRange(new object[] {
"New Game",
"All Legal",
"Everything"});
this.CB_Fashion.Location = new System.Drawing.Point(31, 76);
this.CB_Fashion.Name = "CB_Fashion";
this.CB_Fashion.Size = new System.Drawing.Size(107, 21);
this.CB_Fashion.TabIndex = 60;
//
// SAV_Trainer7
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1915,5 +1930,6 @@ namespace PKHeX.WinForms
private System.Windows.Forms.NumericUpDown NUD_Stat;
private System.Windows.Forms.Label L_Value;
private System.Windows.Forms.Label L_Offset;
private System.Windows.Forms.ComboBox CB_Fashion;
}
}

View file

@ -36,6 +36,7 @@ namespace PKHeX.WinForms
CB_Stats.Items.Add(name);
}
CB_Stats.SelectedIndex = RecordList.First().Key;
CB_Fashion.SelectedIndex = 1;
Loading = false;
}
@ -321,15 +322,51 @@ namespace PKHeX.WinForms
}
private void B_Fashion_Click(object sender, EventArgs e)
{
var prompt = WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Giving all Fashion Items will clear existing data", "Continue?");
var prompt = WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Modifying Fashion Items will clear existing data", "Continue?");
if (DialogResult.Yes != prompt)
return;
// Clear Block
new byte[SAV.FashionLength].CopyTo(SAV.Data, SAV.Fashion);
// Write Payload
byte[] data = SAV.Gender == 0 ? Core.Properties.Resources.fashion_m_sm : Core.Properties.Resources.fashion_f_sm;
data.CopyTo(SAV.Data, SAV.Fashion);
switch (CB_Fashion.SelectedIndex)
{
case 0: // Base Fashion
if (SAV.Gender == 0) // Male
{
SAV.Data[0x42000] = 3;
SAV.Data[0x420FB] = 3;
SAV.Data[0x42124] = 3;
SAV.Data[0x4228F] = 3;
SAV.Data[0x423B4] = 3;
SAV.Data[0x42452] = 3;
SAV.Data[0x42517] = 3;
}
else // Female
{
SAV.Data[0x42000] = 3;
SAV.Data[0x42100] = 3;
SAV.Data[0x42223] = 3;
SAV.Data[0x42288] = 3;
SAV.Data[0x423B4] = 3;
SAV.Data[0x42452] = 3;
SAV.Data[0x42517] = 3;
}
break;
case 1: // Full Legal
byte[] data1 = SAV.Gender == 0 ? Core.Properties.Resources.fashion_m_sm : Core.Properties.Resources.fashion_f_sm;
data1.CopyTo(SAV.Data, SAV.Fashion);
break;
case 2: // Everything
byte[] data2 = SAV.Gender == 0 ? Core.Properties.Resources.fashion_m_sm_illegal : Core.Properties.Resources.fashion_f_sm_illegal;
data2.CopyTo(SAV.Data, SAV.Fashion);
break;
default:
return;
}
System.Media.SystemSounds.Asterisk.Play();
}
private void changeStat(object sender, EventArgs e)
{
@ -351,9 +388,13 @@ namespace PKHeX.WinForms
private readonly Dictionary<int, string> RecordList = new Dictionary<int, string>
{
{000, "Steps Taken"},
{001, "Times Saved"},
{004, "Wild Pokémon Battles"},
{006, "Pokemon Caught"},
{006, "Pokemon Caught Fishing"},
{008, "Eggs Hatched"},
{009, "Pokemon Evolved"},
{011, "Link Trades"},
{012, "Link Battles"},
{013, "Link Battle Wins"},
@ -381,6 +422,7 @@ namespace PKHeX.WinForms
{112, "Pokemon Caught"},
{114, "Trainers Battled"},
{116, "Pokemon Evolved"},
{118, "Fossils Restored"},
{119, "Photos Taken"},
{123, "Loto-ID Wins"},
{124, "PP Raised"},
@ -389,6 +431,8 @@ namespace PKHeX.WinForms
{129, "Facilities Hosted"},
{130, "QR Code Scans"},
{158, "Outfit Changes"},
{161, "Pelago Training Sessions"},
{162, "Pelago Hot Spring Sessions"},
{166, "Island Scans"},
};
}

View file

@ -219,7 +219,9 @@
<None Include="Resources\byte\encounter_sn_sos.pkl" />
<None Include="Resources\byte\evos_sm.pkl" />
<None Include="Resources\byte\fashion_f_sm" />
<None Include="Resources\byte\fashion_f_sm_illegal" />
<None Include="Resources\byte\fashion_m_sm" />
<None Include="Resources\byte\fashion_m_sm_illegal" />
<None Include="Resources\byte\lvlmove_sm.pkl" />
<None Include="Resources\byte\personal_sm" />
<None Include="Resources\byte\wc7.pkl" />

View file

@ -12324,14 +12324,12 @@ namespace PKHeX.Core.Properties {
/// Looks up a localized string similar to PKHeX - By Kaphotics
///http://projectpokemon.org/pkhex
///
///16/12/31 - New Update:
/// - Legality: Added Poké Pelago encounter cases.
/// - Added: Battle Box slot indication separated for locked &amp; unlocked slots. Locked slots remain un-editable.
/// - Added: Record (trainer stat) editing (captured, battles, exp collected, etc) for Gen7.
/// - Added: Starter Choice Event Constant editing.
/// - Added: Relearn move suggestions for static encounters with relearn moves.
/// - Added: Option to set NEW flag when giving items.
/// [rest of string was truncated]&quot;;.
///17/01/30 - New Update:
/// - Added: Control right-clicking a PKM slot (box, party, etc) now allows direct legality checking.
/// - Added: 6/7 detection preferential treatment &amp; other detection methods. Thanks sora10pls!
/// - Added: Remove All medals button now clears Unlocked/Complete flags even if not visible.
/// - Fixed: Badly constructed ShowdownSets throw less exceptions (hopefully none). Thanks Sonic Blader!
/// - Fixed: Cloning to all slots in a Gen1/2 [rest of string was truncated]&quot;;.
/// </summary>
public static string changelog {
get {
@ -12581,6 +12579,16 @@ namespace PKHeX.Core.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
public static byte[] fashion_f_sm_illegal {
get {
object obj = ResourceManager.GetObject("fashion_f_sm_illegal", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
@ -12591,6 +12599,16 @@ namespace PKHeX.Core.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
public static byte[] fashion_m_sm_illegal {
get {
object obj = ResourceManager.GetObject("fashion_m_sm_illegal", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized string similar to 0648 (OR) Groudon Defeated
///2839 (OR) Groudon Captured
@ -17974,7 +17992,7 @@ namespace PKHeX.Core.Properties {
}
/// <summary>
/// Looks up a localized string similar to 20161231.
/// Looks up a localized string similar to 20170130.
/// </summary>
public static string ProgramVersion {
get {
@ -26660,7 +26678,14 @@ namespace PKHeX.Core.Properties {
///
///
///Sonne
///Mond.
///Mond
///
///
///Go
///Rote
///Blaue
///Grüne
///Gelbe.
/// </summary>
public static string text_games_de {
get {
@ -26700,7 +26725,14 @@ namespace PKHeX.Core.Properties {
///
///
///Sun
///Moon.
///Moon
///
///
///Go
///Red
///Blue
///Green
///Yellow.
/// </summary>
public static string text_games_en {
get {
@ -26740,7 +26772,14 @@ namespace PKHeX.Core.Properties {
///
///
///Sol
///Luna.
///Luna
///
///
///Go
///Roja
///Azul
///Verde
///Amarilla.
/// </summary>
public static string text_games_es {
get {
@ -26780,7 +26819,14 @@ namespace PKHeX.Core.Properties {
///
///
///Soleil
///Lune.
///Lune
///
///
///Go
///Rouge
///Bleue
///Vert
///Jaune.
/// </summary>
public static string text_games_fr {
get {
@ -26820,7 +26866,14 @@ namespace PKHeX.Core.Properties {
///
///
///Sole
///Luna.
///Luna
///
///
///Go
///Rossa
///Blu
///Verde
///Gialla.
/// </summary>
public static string text_games_it {
get {
@ -26860,7 +26913,14 @@ namespace PKHeX.Core.Properties {
///
///
///サン
///ムーン.
///ムーン
///
///
///Go
///赤
///青
///緑
///黄.
/// </summary>
public static string text_games_ja {
get {
@ -26884,7 +26944,7 @@ namespace PKHeX.Core.Properties {
///Pt기라티나
///
///
///세움/XD
///콜로세움/XD
///
///
///
@ -26900,7 +26960,14 @@ namespace PKHeX.Core.Properties {
///
///
///썬
///문.
///문
///
///
///고
///레드
///블루
///그린
///옐로.
/// </summary>
public static string text_games_ko {
get {
@ -26940,7 +27007,14 @@ namespace PKHeX.Core.Properties {
///
///
///太阳
///月亮.
///月亮
///
///
///Go
///紅
///藍色
///綠色
///黃色.
/// </summary>
public static string text_games_zh {
get {

View file

@ -7378,4 +7378,10 @@
<data name="_6th" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\misc\6th.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="fashion_f_sm_illegal" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\fashion_f_sm_illegal;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="fashion_m_sm_illegal" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\fashion_m_sm_illegal;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

Binary file not shown.

Binary file not shown.