[SV] Give All Clothing button (#3876)

* Mapped Fashion items for S/V and added injection logic
* Added 'Unlock Clothes' button in Trainer Editor's misc section alongside ComboBox to select type to add all.
This commit is contained in:
Pasquale Nardiello 2023-05-26 19:24:27 +02:00 committed by GitHub
parent 6c3a8b8377
commit 3ca16b435c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 332 additions and 57 deletions

View file

@ -96,14 +96,14 @@ public sealed class SaveBlockAccessor9SV : SCBlockAccessor, ISaveBlock9Main
private const uint KLastGreenPosition = 0x5C6F8291; // PlayerSave_LastGreenPos
// Fashion
private const uint KFashionUnlockedEyewear = 0xCBA20ED5; // 1000-1999
private const uint KFashionUnlockedGloves = 0x581667B1; // 2000-2999
private const uint KFashionUnlockedBag = 0x5D6F8110; // 3000-3999
private const uint KFashionUnlockedFootwear = 0x0221A618; // 4000-4999
private const uint KFashionUnlockedHeadwear = 0x860CD8FB; // 5000-5999
private const uint KFashionUnlockedLegwear = 0xD186222E; // 6000-6999
private const uint KFashionUnlockedUniform = 0x78FF2CB2; // 7000-7999
private const uint KFashionUnlockedPhoneCase = 0xED0AC675; // 8000-8999
public const uint KFashionUnlockedEyewear = 0xCBA20ED5; // 1000-1999
public const uint KFashionUnlockedGloves = 0x581667B1; // 2000-2999
public const uint KFashionUnlockedBag = 0x5D6F8110; // 3000-3999
public const uint KFashionUnlockedFootwear = 0x0221A618; // 4000-4999
public const uint KFashionUnlockedHeadwear = 0x860CD8FB; // 5000-5999
public const uint KFashionUnlockedLegwear = 0xD186222E; // 6000-6999
public const uint KFashionUnlockedUniform = 0x78FF2CB2; // 7000-7999
public const uint KFashionUnlockedPhoneCase = 0xED0AC675; // 8000-8999
// Profile Picture
public const uint KPictureProfileCurrentWidth = 0xFEAA87DA;

View file

@ -0,0 +1,230 @@
using System;
using System.Collections.Generic;
using static System.Buffers.Binary.BinaryPrimitives;
using static PKHeX.Core.SaveBlockAccessor9SV;
namespace PKHeX.Core;
public static class PlayerFashionUnlock9
{
// All base game clothing options
private static ReadOnlySpan<ushort> BaseBags => new ushort[]
{
3044, 3002, 3033, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3042, 3043, 3045, 3046,
3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017, 3018, 3019, 3020, 3021, 3022,
3076, 3077, 3078, 3079, 3080, 3081, 3082, 3083, 3084, 3085, 3086, 3087, 3088, 3089, 3090, 3091, 3092, 3064, 3065, 3066,
3023, 3024, 3025, 3026, 3027, 3028, 3029, 3030, 3031, 3032, 3073, 3074, 3050, 3051, 3052, 3053, 3054, 3055, 3056, 3057,
3058, 3059, 3060, 3061, 3062, 3067, 3063, 3068, 3069, 3070, 3071, 3072,
};
private static ReadOnlySpan<ushort> BaseCases => new ushort[]
{
8005, 8046, 8002, 8003, 8004, 8006, 8007, 8009, 8008, 8010, 8011, 8012, 8013, 8014, 8015,
8026, 8027, 8028, 8029, 8030, 8031, 8032, 8033, 8034, 8035, 8036, 8037, 8039, 8038, 8040, 8041, 8042, 8043, 8045, 8044,
8047, 8000, 8001, 8016, 8017, 8018, 8019, 8020, 8021, 8022, 8023, 8024, 8025, 8048, 8049, 8050,
};
private static ReadOnlySpan<ushort> BaseEyewear => new ushort[]
{
1002, 1114, 1145, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031,
1032, 1033, 1034, 1035, 1036, 1037, 1038, 1001, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014,
1015, 1016, 1018, 1017, 1019, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053,
1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073,
1074, 1075, 1076, 1077, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109,
1110, 1111, 1112, 1113, 1128, 1129, 1130, 1132, 1131, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143,
1144, 1146, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1115, 1116,
1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127,
};
private static ReadOnlySpan<ushort> BaseFootwear => new ushort[]
{
4002, 4001, 4112, 4125, 4123, 4003, 4004, 4005, 4007, 4006, 4008, 4009, 4010, 4011, 4012,
4013, 4014, 4015, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035,
4036, 4037, 4038, 4039, 4040, 4041, 4071, 4072, 4073, 4081, 4082, 4083, 4064, 4065, 4066, 4067, 4068, 4069, 4070, 4074,
4075, 4076, 4077, 4078, 4079, 4080, 4084, 4085, 4086, 4087, 4088, 4089, 4090, 4091, 4092, 4093, 4094, 4095, 4096, 4098,
4097, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4110, 4109, 4111, 4113, 4114, 4115, 4116, 4117, 4118,
4119, 4120, 4122, 4121, 4124, 4126, 4127, 4128, 4129, 4130, 4131, 4132, 4133, 4134, 4135, 4136, 4137, 4138, 4139, 4140,
4141, 4142, 4143, 4016, 4017, 4018, 4042, 4043, 4044, 4051, 4052, 4053, 4054, 4055, 4056, 4057, 4058, 4059, 4060, 4061,
4062, 4063, 4045, 4046, 4047, 4048, 4049, 4050,
};
private static ReadOnlySpan<ushort> BaseGloves => new ushort[]
{
2001, 2020, 2023, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079,
2080, 2081, 2094, 2095, 2096, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2010, 2012, 2013, 2014, 2015, 2058,
2059, 2060, 2061, 2062, 2082, 2083, 2084, 2086, 2085, 2087, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039,
2040, 2041, 2042, 2044, 2043, 2045, 2046, 2047, 2049, 2048, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2063, 2064,
2065, 2066, 2067, 2088, 2089, 2090, 2091, 2092, 2093, 2016, 2017, 2018, 2019, 2021, 2022, 2024, 2025, 2026, 2027, 2028,
2029,
};
private static ReadOnlySpan<ushort> BaseHeadwear => new ushort[]
{
5002, 5001, 5244, 5003, 5004, 5005, 5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014,
5015, 5016, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 5025, 5026, 5027, 5028, 5029, 5030, 5031, 5032, 5033, 5040,
5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5055, 5056, 5057, 5074, 5075, 5076,
5077, 5078, 5079, 5080, 5081, 5082, 5083, 5084, 5085, 5086, 5087, 5088, 5089, 5090, 5058, 5059, 5060, 5061, 5062, 5063,
5064, 5065, 5066, 5067, 5068, 5069, 5070, 5091, 5092, 5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103,
5104, 5105, 5106, 5107, 5142, 5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5151, 5152, 5153, 5154, 5155, 5156, 5157,
5158, 5108, 5109, 5110, 5111, 5112, 5113, 5114, 5115, 5116, 5117, 5118, 5119, 5120, 5121, 5122, 5123, 5124, 5210, 5211,
5212, 5213, 5214, 5215, 5216, 5217, 5218, 5219, 5220, 5221, 5222, 5223, 5224, 5225, 5226, 5227, 5228, 5229, 5232, 5230,
5231, 5233, 5234, 5235, 5236, 5237, 5239, 5238, 5240, 5241, 5242, 5243, 5245, 5246, 5247, 5248, 5249, 5250, 5251, 5252,
5253, 5254, 5255, 5256, 5257, 5258, 5259, 5260, 5261, 5262, 5263, 5264, 5265, 5266, 5267, 5268, 5269, 5270, 5271, 5272,
5273, 5274, 5275, 5276, 5277, 5278, 5279, 5280, 5281, 5282, 5283, 5284, 5285, 5286, 5287, 5288, 5289, 5290, 5291, 5292,
5293, 5361, 5362, 5363, 5364, 5366, 5365, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 5375, 5376, 5377, 5378, 5379,
5380, 5381, 5382, 5384, 5383, 5385, 5386, 5387, 5388, 5389, 5390, 5391, 5392, 5393, 5394, 5395, 5396, 5397, 5398, 5399,
5400, 5401, 5402, 5403, 5404, 5405, 5406, 5407, 5408, 5409, 5410, 5411, 5412, 5034, 5035, 5036, 5125, 5126, 5127, 5128,
5129, 5130, 5131, 5132, 5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5159, 5160, 5161, 5162, 5163, 5164, 5165,
5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 5175, 5193, 5194, 5195, 5196, 5197, 5198, 5199, 5200, 5201, 5202,
5203, 5204, 5205, 5206, 5207, 5208, 5209, 5176, 5177, 5178, 5179, 5180, 5181, 5182, 5183, 5184, 5185, 5186, 5187, 5188,
5189, 5190, 5191, 5192, 5071, 5072, 5073, 5294, 5295, 5296, 5297, 5298, 5299, 5300, 5301, 5302, 5303, 5304, 5305, 5306,
5307, 5308, 5309, 5310, 5311, 5312, 5313, 5314, 5315, 5316, 5317, 5318, 5319, 5320, 5321, 5322, 5323, 5324, 5325, 5326,
5327, 5328, 5329, 5330, 5331, 5332, 5333, 5334, 5335, 5336, 5337, 5338, 5339, 5340, 5341, 5342, 5343, 5344, 5345, 5346,
5347, 5348, 5349, 5350, 5351, 5352, 5353, 5354, 5355, 5356, 5357, 5358, 5359, 5360,
};
private static ReadOnlySpan<ushort> BaseLegwear => new ushort[]
{
6045, 6000, 6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, 6009, 6010, 6011, 6012, 6013,
6014, 6015, 6016, 6017, 6018, 6020, 6019, 6021, 6022, 6023, 6024, 6025, 6026, 6027, 6028, 6029, 6030, 6031, 6032, 6033,
6034, 6097, 6098, 6099, 6049, 6050, 6051, 6052, 6053, 6103, 6104, 6105, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042,
6043, 6044, 6046, 6047, 6054, 6048, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068,
6069, 6070, 6071, 6072, 6073, 6074, 6075, 6076, 6077, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 6087, 6088,
6089, 6090, 6091, 6092, 6093, 6094, 6095, 6096, 6100, 6101, 6102,
};
private static ReadOnlySpan<ushort> BaseUniformsMale => new ushort[] { 7000, 7001, 7002, 7003 };
private static ReadOnlySpan<ushort> BaseUniformsFemale => new ushort[] { 7004, 7005, 7006, 7007 };
// Not purchasable base clothing options
private static ReadOnlySpan<ushort> LeagueStarHeadwear => new ushort[] { 5037, 5038 };
// Previous games phone cases
private static ReadOnlySpan<ushort> CasesRotometery => new ushort[] { 8051, 8052, 8053, 8054 };
// DLCs preorder clothing options
private static ReadOnlySpan<ushort> PreorderBags => new ushort[] { 3093 };
private static ReadOnlySpan<ushort> PreorderFootwear => new ushort[] { 4144 };
private static ReadOnlySpan<ushort> PreorderGloves => new ushort[] { 2097 };
private static ReadOnlySpan<ushort> PreorderHeadwear => new ushort[] { 5413 };
private static ReadOnlySpan<ushort> PreorderLegwear => new ushort[] { 6107, 6108 };
private static ReadOnlySpan<ushort> PreorderUniformsFemale => new ushort[] { 7008, 7009, 7010, 7011 };
private static ReadOnlySpan<ushort> PreorderUniformsMale => new ushort[] { 7012, 7013, 7014, 7015 };
// PokéPortal special clothing options
private static ReadOnlySpan<ushort> GiftBags => new ushort[]
{
3047, // canvas_pokeball
3048, // canvas_megaball
3049, // canvas_ultraball
3075, // floral_print
};
public static int Add(SCBlockAccessor acc, uint key, ReadOnlySpan<ushort> add)
{
var block = acc.GetBlock(key);
var data = block.Data;
return Add(data, add);
}
private const int entrySize = 8;
public static int Add(Span<byte> data, ReadOnlySpan<ushort> add)
{
var missing = new HashSet<ushort>(add.Length);
foreach (var item in add)
missing.Add(item);
while (data.Length >= entrySize)
{
var item = ReadUInt16LittleEndian(data);
if (item == ushort.MaxValue)
break;
missing.Remove(item);
data = data[entrySize..];
}
if (missing.Count == 0)
return 0;
return AddItems(data, missing);
}
private static int AddItems(Span<byte> data, IEnumerable<ushort> missing)
{
int added = 0;
foreach (var item in missing)
{
if (data.Length < entrySize)
break;
WriteUInt16LittleEndian(data, item);
WriteUInt16LittleEndian(data[2..], 0);
WriteUInt16LittleEndian(data[4..], 1);
WriteUInt16LittleEndian(data[6..], 0);
added++;
data = data[entrySize..];
}
return added;
}
public static int UnlockBase(SCBlockAccessor acc, int playerGender)
{
int count = 0;
count += Add(acc, KFashionUnlockedBag, BaseBags);
count += Add(acc, KFashionUnlockedPhoneCase, BaseCases);
count += Add(acc, KFashionUnlockedEyewear, BaseEyewear);
count += Add(acc, KFashionUnlockedFootwear, BaseFootwear);
count += Add(acc, KFashionUnlockedGloves, BaseGloves);
count += Add(acc, KFashionUnlockedHeadwear, BaseHeadwear);
count += Add(acc, KFashionUnlockedLegwear, BaseLegwear);
if (playerGender == 0)
{
count += Add(acc, KFashionUnlockedUniform, BaseUniformsMale);
}
else if (playerGender == 1)
{
count += Add(acc, KFashionUnlockedUniform, BaseUniformsFemale);
}
return count;
}
public static int UnlockExtras(SCBlockAccessor acc)
{
int count = 0;
count += Add(acc, KFashionUnlockedPhoneCase, CasesRotometery);
count += Add(acc, KFashionUnlockedHeadwear, LeagueStarHeadwear);
return count;
}
public static int UnlockPortal(SCBlockAccessor acc)
{
int count = 0;
count += Add(acc, KFashionUnlockedBag, GiftBags);
return count;
}
public static int UnlockPreorder(SCBlockAccessor acc, int playerGender)
{
int count = 0;
count += Add(acc, KFashionUnlockedBag, PreorderBags);
count += Add(acc, KFashionUnlockedFootwear, PreorderFootwear);
count += Add(acc, KFashionUnlockedGloves, PreorderGloves);
count += Add(acc, KFashionUnlockedHeadwear, PreorderHeadwear);
count += Add(acc, KFashionUnlockedLegwear, PreorderLegwear);
if (playerGender == 0)
{
count += Add(acc, KFashionUnlockedUniform, PreorderUniformsMale);
}
else if (playerGender == 1)
{
count += Add(acc, KFashionUnlockedUniform, PreorderUniformsFemale);
}
return count;
}
}

View file

@ -319,6 +319,7 @@ public static class MessageStrings
#endregion
#region Misc
public static string MsgClothingAdded { get; set; } = "Added {0} clothing options.";
public static string MsgSaveDifferentTypes { get; set; } = "Save File types are different.";
public static string MsgSaveDifferentVersions { get; set; } = "Save File versions are not the same.";

View file

@ -98,6 +98,8 @@ namespace PKHeX.WinForms
B_MaxLP = new System.Windows.Forms.Button();
L_LP = new System.Windows.Forms.Label();
Tab_MiscValues = new System.Windows.Forms.TabPage();
CB_Fashion = new System.Windows.Forms.ComboBox();
B_UnlockClothing = new System.Windows.Forms.Button();
B_UnlockBikeUpgrades = new System.Windows.Forms.Button();
B_UnlockTMRecipes = new System.Windows.Forms.Button();
B_CollectAllStakes = new System.Windows.Forms.Button();
@ -157,7 +159,7 @@ namespace PKHeX.WinForms
TB_OTName.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
TB_OTName.MaxLength = 12;
TB_OTName.Name = "TB_OTName";
TB_OTName.Size = new System.Drawing.Size(120, 20);
TB_OTName.Size = new System.Drawing.Size(120, 23);
TB_OTName.TabIndex = 2;
TB_OTName.Text = "WWWWWWWWWWWW";
TB_OTName.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
@ -179,7 +181,7 @@ namespace PKHeX.WinForms
MT_Money.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
MT_Money.Mask = "0000000";
MT_Money.Name = "MT_Money";
MT_Money.Size = new System.Drawing.Size(67, 23);
MT_Money.Size = new System.Drawing.Size(67, 27);
MT_Money.TabIndex = 4;
MT_Money.Text = "1234567";
MT_Money.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
@ -233,35 +235,35 @@ namespace PKHeX.WinForms
//
TB_Saying5.Location = new System.Drawing.Point(0, 0);
TB_Saying5.Name = "TB_Saying5";
TB_Saying5.Size = new System.Drawing.Size(100, 23);
TB_Saying5.Size = new System.Drawing.Size(100, 27);
TB_Saying5.TabIndex = 0;
//
// TB_Saying4
//
TB_Saying4.Location = new System.Drawing.Point(0, 0);
TB_Saying4.Name = "TB_Saying4";
TB_Saying4.Size = new System.Drawing.Size(100, 23);
TB_Saying4.Size = new System.Drawing.Size(100, 27);
TB_Saying4.TabIndex = 0;
//
// TB_Saying3
//
TB_Saying3.Location = new System.Drawing.Point(0, 0);
TB_Saying3.Name = "TB_Saying3";
TB_Saying3.Size = new System.Drawing.Size(100, 23);
TB_Saying3.Size = new System.Drawing.Size(100, 27);
TB_Saying3.TabIndex = 0;
//
// TB_Saying2
//
TB_Saying2.Location = new System.Drawing.Point(0, 0);
TB_Saying2.Name = "TB_Saying2";
TB_Saying2.Size = new System.Drawing.Size(100, 23);
TB_Saying2.Size = new System.Drawing.Size(100, 27);
TB_Saying2.TabIndex = 0;
//
// TB_Saying1
//
TB_Saying1.Location = new System.Drawing.Point(0, 0);
TB_Saying1.Name = "TB_Saying1";
TB_Saying1.Size = new System.Drawing.Size(100, 23);
TB_Saying1.Size = new System.Drawing.Size(100, 27);
TB_Saying1.TabIndex = 0;
//
// L_Seconds
@ -290,7 +292,7 @@ namespace PKHeX.WinForms
MT_Seconds.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
MT_Seconds.Mask = "00";
MT_Seconds.Name = "MT_Seconds";
MT_Seconds.Size = new System.Drawing.Size(25, 23);
MT_Seconds.Size = new System.Drawing.Size(25, 27);
MT_Seconds.TabIndex = 28;
MT_Seconds.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
MT_Seconds.TextChanged += Change255;
@ -301,7 +303,7 @@ namespace PKHeX.WinForms
MT_Minutes.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
MT_Minutes.Mask = "00";
MT_Minutes.Name = "MT_Minutes";
MT_Minutes.Size = new System.Drawing.Size(25, 23);
MT_Minutes.Size = new System.Drawing.Size(25, 27);
MT_Minutes.TabIndex = 27;
MT_Minutes.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
MT_Minutes.TextChanged += Change255;
@ -322,7 +324,7 @@ namespace PKHeX.WinForms
MT_Hours.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
MT_Hours.Mask = "00000";
MT_Hours.Name = "MT_Hours";
MT_Hours.Size = new System.Drawing.Size(56, 23);
MT_Hours.Size = new System.Drawing.Size(56, 27);
MT_Hours.TabIndex = 25;
MT_Hours.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
@ -353,7 +355,7 @@ namespace PKHeX.WinForms
CB_Language.Location = new System.Drawing.Point(170, 150);
CB_Language.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
CB_Language.Name = "CB_Language";
CB_Language.Size = new System.Drawing.Size(120, 23);
CB_Language.Size = new System.Drawing.Size(120, 28);
CB_Language.TabIndex = 15;
//
// CB_Game
@ -364,7 +366,7 @@ namespace PKHeX.WinForms
CB_Game.Location = new System.Drawing.Point(170, 123);
CB_Game.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
CB_Game.Name = "CB_Game";
CB_Game.Size = new System.Drawing.Size(120, 23);
CB_Game.Size = new System.Drawing.Size(120, 28);
CB_Game.TabIndex = 24;
//
// CB_Gender
@ -375,77 +377,77 @@ namespace PKHeX.WinForms
CB_Gender.Location = new System.Drawing.Point(293, 123);
CB_Gender.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
CB_Gender.Name = "CB_Gender";
CB_Gender.Size = new System.Drawing.Size(33, 23);
CB_Gender.Size = new System.Drawing.Size(33, 28);
CB_Gender.TabIndex = 22;
//
// TB_MBMS
//
TB_MBMS.Location = new System.Drawing.Point(0, 0);
TB_MBMS.Name = "TB_MBMS";
TB_MBMS.Size = new System.Drawing.Size(100, 23);
TB_MBMS.Size = new System.Drawing.Size(100, 27);
TB_MBMS.TabIndex = 0;
//
// TB_MBMN
//
TB_MBMN.Location = new System.Drawing.Point(0, 0);
TB_MBMN.Name = "TB_MBMN";
TB_MBMN.Size = new System.Drawing.Size(100, 23);
TB_MBMN.Size = new System.Drawing.Size(100, 27);
TB_MBMN.TabIndex = 0;
//
// TB_MBRS
//
TB_MBRS.Location = new System.Drawing.Point(0, 0);
TB_MBRS.Name = "TB_MBRS";
TB_MBRS.Size = new System.Drawing.Size(100, 23);
TB_MBRS.Size = new System.Drawing.Size(100, 27);
TB_MBRS.TabIndex = 0;
//
// TB_MBRN
//
TB_MBRN.Location = new System.Drawing.Point(0, 0);
TB_MBRN.Name = "TB_MBRN";
TB_MBRN.Size = new System.Drawing.Size(100, 23);
TB_MBRN.Size = new System.Drawing.Size(100, 27);
TB_MBRN.TabIndex = 0;
//
// TB_MBTS
//
TB_MBTS.Location = new System.Drawing.Point(0, 0);
TB_MBTS.Name = "TB_MBTS";
TB_MBTS.Size = new System.Drawing.Size(100, 23);
TB_MBTS.Size = new System.Drawing.Size(100, 27);
TB_MBTS.TabIndex = 0;
//
// TB_MBTN
//
TB_MBTN.Location = new System.Drawing.Point(0, 0);
TB_MBTN.Name = "TB_MBTN";
TB_MBTN.Size = new System.Drawing.Size(100, 23);
TB_MBTN.Size = new System.Drawing.Size(100, 27);
TB_MBTN.TabIndex = 0;
//
// TB_MBDS
//
TB_MBDS.Location = new System.Drawing.Point(0, 0);
TB_MBDS.Name = "TB_MBDS";
TB_MBDS.Size = new System.Drawing.Size(100, 23);
TB_MBDS.Size = new System.Drawing.Size(100, 27);
TB_MBDS.TabIndex = 0;
//
// TB_MBDN
//
TB_MBDN.Location = new System.Drawing.Point(0, 0);
TB_MBDN.Name = "TB_MBDN";
TB_MBDN.Size = new System.Drawing.Size(100, 23);
TB_MBDN.Size = new System.Drawing.Size(100, 27);
TB_MBDN.TabIndex = 0;
//
// TB_MBSS
//
TB_MBSS.Location = new System.Drawing.Point(0, 0);
TB_MBSS.Name = "TB_MBSS";
TB_MBSS.Size = new System.Drawing.Size(100, 23);
TB_MBSS.Size = new System.Drawing.Size(100, 27);
TB_MBSS.TabIndex = 0;
//
// TB_MBSN
//
TB_MBSN.Location = new System.Drawing.Point(0, 0);
TB_MBSN.Name = "TB_MBSN";
TB_MBSN.Size = new System.Drawing.Size(100, 23);
TB_MBSN.Size = new System.Drawing.Size(100, 27);
TB_MBSN.TabIndex = 0;
//
// L_SuperB
@ -501,70 +503,70 @@ namespace PKHeX.WinForms
//
TB_MCMS.Location = new System.Drawing.Point(0, 0);
TB_MCMS.Name = "TB_MCMS";
TB_MCMS.Size = new System.Drawing.Size(100, 23);
TB_MCMS.Size = new System.Drawing.Size(100, 27);
TB_MCMS.TabIndex = 0;
//
// TB_MCMN
//
TB_MCMN.Location = new System.Drawing.Point(0, 0);
TB_MCMN.Name = "TB_MCMN";
TB_MCMN.Size = new System.Drawing.Size(100, 23);
TB_MCMN.Size = new System.Drawing.Size(100, 27);
TB_MCMN.TabIndex = 0;
//
// TB_MCRS
//
TB_MCRS.Location = new System.Drawing.Point(0, 0);
TB_MCRS.Name = "TB_MCRS";
TB_MCRS.Size = new System.Drawing.Size(100, 23);
TB_MCRS.Size = new System.Drawing.Size(100, 27);
TB_MCRS.TabIndex = 0;
//
// TB_MCRN
//
TB_MCRN.Location = new System.Drawing.Point(0, 0);
TB_MCRN.Name = "TB_MCRN";
TB_MCRN.Size = new System.Drawing.Size(100, 23);
TB_MCRN.Size = new System.Drawing.Size(100, 27);
TB_MCRN.TabIndex = 0;
//
// TB_MCTS
//
TB_MCTS.Location = new System.Drawing.Point(0, 0);
TB_MCTS.Name = "TB_MCTS";
TB_MCTS.Size = new System.Drawing.Size(100, 23);
TB_MCTS.Size = new System.Drawing.Size(100, 27);
TB_MCTS.TabIndex = 0;
//
// TB_MCTN
//
TB_MCTN.Location = new System.Drawing.Point(0, 0);
TB_MCTN.Name = "TB_MCTN";
TB_MCTN.Size = new System.Drawing.Size(100, 23);
TB_MCTN.Size = new System.Drawing.Size(100, 27);
TB_MCTN.TabIndex = 0;
//
// TB_MCDS
//
TB_MCDS.Location = new System.Drawing.Point(0, 0);
TB_MCDS.Name = "TB_MCDS";
TB_MCDS.Size = new System.Drawing.Size(100, 23);
TB_MCDS.Size = new System.Drawing.Size(100, 27);
TB_MCDS.TabIndex = 0;
//
// TB_MCDN
//
TB_MCDN.Location = new System.Drawing.Point(0, 0);
TB_MCDN.Name = "TB_MCDN";
TB_MCDN.Size = new System.Drawing.Size(100, 23);
TB_MCDN.Size = new System.Drawing.Size(100, 27);
TB_MCDN.TabIndex = 0;
//
// TB_MCSS
//
TB_MCSS.Location = new System.Drawing.Point(0, 0);
TB_MCSS.Name = "TB_MCSS";
TB_MCSS.Size = new System.Drawing.Size(100, 23);
TB_MCSS.Size = new System.Drawing.Size(100, 27);
TB_MCSS.TabIndex = 0;
//
// TB_MCSN
//
TB_MCSN.Location = new System.Drawing.Point(0, 0);
TB_MCSN.Name = "TB_MCSN";
TB_MCSN.Size = new System.Drawing.Size(100, 23);
TB_MCSN.Size = new System.Drawing.Size(100, 27);
TB_MCSN.TabIndex = 0;
//
// L_SuperC
@ -652,11 +654,11 @@ namespace PKHeX.WinForms
Tab_Overview.Controls.Add(B_MaxCash);
Tab_Overview.Controls.Add(MT_Seconds);
Tab_Overview.Controls.Add(L_Seconds);
Tab_Overview.Location = new System.Drawing.Point(4, 24);
Tab_Overview.Location = new System.Drawing.Point(4, 29);
Tab_Overview.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
Tab_Overview.Name = "Tab_Overview";
Tab_Overview.Padding = new System.Windows.Forms.Padding(5, 4, 5, 4);
Tab_Overview.Size = new System.Drawing.Size(488, 241);
Tab_Overview.Size = new System.Drawing.Size(488, 236);
Tab_Overview.TabIndex = 0;
Tab_Overview.Text = "Overview";
Tab_Overview.UseVisualStyleBackColor = true;
@ -687,7 +689,7 @@ namespace PKHeX.WinForms
CAL_AdventureStartDate.MaxDate = new System.DateTime(2050, 12, 31, 0, 0, 0, 0);
CAL_AdventureStartDate.MinDate = new System.DateTime(1932, 1, 1, 0, 0, 0, 0);
CAL_AdventureStartDate.Name = "CAL_AdventureStartDate";
CAL_AdventureStartDate.Size = new System.Drawing.Size(120, 23);
CAL_AdventureStartDate.Size = new System.Drawing.Size(120, 27);
CAL_AdventureStartDate.TabIndex = 72;
CAL_AdventureStartDate.Value = new System.DateTime(2000, 1, 1, 0, 0, 0, 0);
//
@ -697,7 +699,7 @@ namespace PKHeX.WinForms
MT_LP.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
MT_LP.Mask = "0000000";
MT_LP.Name = "MT_LP";
MT_LP.Size = new System.Drawing.Size(67, 23);
MT_LP.Size = new System.Drawing.Size(67, 27);
MT_LP.TabIndex = 70;
MT_LP.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
@ -723,23 +725,46 @@ namespace PKHeX.WinForms
//
// Tab_MiscValues
//
Tab_MiscValues.Controls.Add(CB_Fashion);
Tab_MiscValues.Controls.Add(B_UnlockClothing);
Tab_MiscValues.Controls.Add(B_UnlockBikeUpgrades);
Tab_MiscValues.Controls.Add(B_UnlockTMRecipes);
Tab_MiscValues.Controls.Add(B_CollectAllStakes);
Tab_MiscValues.Controls.Add(B_UnlockFlyLocations);
Tab_MiscValues.Controls.Add(GB_Map);
Tab_MiscValues.Location = new System.Drawing.Point(4, 24);
Tab_MiscValues.Location = new System.Drawing.Point(4, 29);
Tab_MiscValues.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
Tab_MiscValues.Name = "Tab_MiscValues";
Tab_MiscValues.Padding = new System.Windows.Forms.Padding(5, 4, 5, 4);
Tab_MiscValues.Size = new System.Drawing.Size(488, 241);
Tab_MiscValues.Size = new System.Drawing.Size(488, 236);
Tab_MiscValues.TabIndex = 4;
Tab_MiscValues.Text = "Misc";
Tab_MiscValues.UseVisualStyleBackColor = true;
//
// CB_Fashion
//
CB_Fashion.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
CB_Fashion.FormattingEnabled = true;
CB_Fashion.Items.AddRange(new object[] { "All base game clothes", "Extra hats and Rotometry cases", "DLCs preorder clothes", "PokéPortal clothes" });
CB_Fashion.Location = new System.Drawing.Point(15, 199);
CB_Fashion.Name = "CB_Fashion";
CB_Fashion.Size = new System.Drawing.Size(260, 28);
CB_Fashion.TabIndex = 65;
//
// B_UnlockClothing
//
B_UnlockClothing.Location = new System.Drawing.Point(15, 151);
B_UnlockClothing.Margin = new System.Windows.Forms.Padding(0);
B_UnlockClothing.Name = "B_UnlockClothing";
B_UnlockClothing.Size = new System.Drawing.Size(260, 45);
B_UnlockClothing.TabIndex = 64;
B_UnlockClothing.Text = "Unlock Clothing Options";
B_UnlockClothing.UseVisualStyleBackColor = true;
B_UnlockClothing.Click += B_UnlockClothing_Click;
//
// B_UnlockBikeUpgrades
//
B_UnlockBikeUpgrades.Location = new System.Drawing.Point(295, 175);
B_UnlockBikeUpgrades.Location = new System.Drawing.Point(294, 178);
B_UnlockBikeUpgrades.Margin = new System.Windows.Forms.Padding(0);
B_UnlockBikeUpgrades.Name = "B_UnlockBikeUpgrades";
B_UnlockBikeUpgrades.Size = new System.Drawing.Size(180, 45);
@ -750,7 +775,7 @@ namespace PKHeX.WinForms
//
// B_UnlockTMRecipes
//
B_UnlockTMRecipes.Location = new System.Drawing.Point(295, 124);
B_UnlockTMRecipes.Location = new System.Drawing.Point(294, 127);
B_UnlockTMRecipes.Margin = new System.Windows.Forms.Padding(0);
B_UnlockTMRecipes.Name = "B_UnlockTMRecipes";
B_UnlockTMRecipes.Size = new System.Drawing.Size(180, 45);
@ -761,7 +786,7 @@ namespace PKHeX.WinForms
//
// B_CollectAllStakes
//
B_CollectAllStakes.Location = new System.Drawing.Point(295, 73);
B_CollectAllStakes.Location = new System.Drawing.Point(294, 76);
B_CollectAllStakes.Margin = new System.Windows.Forms.Padding(0);
B_CollectAllStakes.Name = "B_CollectAllStakes";
B_CollectAllStakes.Size = new System.Drawing.Size(180, 45);
@ -772,7 +797,7 @@ namespace PKHeX.WinForms
//
// B_UnlockFlyLocations
//
B_UnlockFlyLocations.Location = new System.Drawing.Point(295, 22);
B_UnlockFlyLocations.Location = new System.Drawing.Point(294, 25);
B_UnlockFlyLocations.Margin = new System.Windows.Forms.Padding(0);
B_UnlockFlyLocations.Name = "B_UnlockFlyLocations";
B_UnlockFlyLocations.Size = new System.Drawing.Size(180, 45);
@ -789,7 +814,7 @@ namespace PKHeX.WinForms
GB_Map.Controls.Add(L_Y);
GB_Map.Controls.Add(L_Z);
GB_Map.Controls.Add(L_X);
GB_Map.Location = new System.Drawing.Point(16, 15);
GB_Map.Location = new System.Drawing.Point(15, 18);
GB_Map.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
GB_Map.Name = "GB_Map";
GB_Map.Padding = new System.Windows.Forms.Padding(5, 4, 5, 4);
@ -807,7 +832,7 @@ namespace PKHeX.WinForms
NUD_Z.Maximum = new decimal(new int[] { 99999999, 0, 0, 0 });
NUD_Z.Minimum = new decimal(new int[] { 99999999, 0, 0, int.MinValue });
NUD_Z.Name = "NUD_Z";
NUD_Z.Size = new System.Drawing.Size(148, 23);
NUD_Z.Size = new System.Drawing.Size(148, 27);
NUD_Z.TabIndex = 53;
NUD_Z.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
NUD_Z.ValueChanged += ChangeMapValue;
@ -821,7 +846,7 @@ namespace PKHeX.WinForms
NUD_Y.Maximum = new decimal(new int[] { 99999999, 0, 0, 0 });
NUD_Y.Minimum = new decimal(new int[] { 99999999, 0, 0, int.MinValue });
NUD_Y.Name = "NUD_Y";
NUD_Y.Size = new System.Drawing.Size(148, 23);
NUD_Y.Size = new System.Drawing.Size(148, 27);
NUD_Y.TabIndex = 51;
NUD_Y.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
NUD_Y.ValueChanged += ChangeMapValue;
@ -835,7 +860,7 @@ namespace PKHeX.WinForms
NUD_X.Maximum = new decimal(new int[] { 99999999, 0, 0, 0 });
NUD_X.Minimum = new decimal(new int[] { 99999999, 0, 0, int.MinValue });
NUD_X.Name = "NUD_X";
NUD_X.Size = new System.Drawing.Size(148, 23);
NUD_X.Size = new System.Drawing.Size(148, 27);
NUD_X.TabIndex = 50;
NUD_X.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
NUD_X.ValueChanged += ChangeMapValue;
@ -875,9 +900,9 @@ namespace PKHeX.WinForms
Tab_Images.Controls.Add(P_InitialIcon);
Tab_Images.Controls.Add(P_CurrIcon);
Tab_Images.Controls.Add(P_CurrPhoto);
Tab_Images.Location = new System.Drawing.Point(4, 24);
Tab_Images.Location = new System.Drawing.Point(4, 29);
Tab_Images.Name = "Tab_Images";
Tab_Images.Size = new System.Drawing.Size(488, 241);
Tab_Images.Size = new System.Drawing.Size(488, 236);
Tab_Images.TabIndex = 5;
Tab_Images.Text = "Images";
Tab_Images.UseVisualStyleBackColor = true;
@ -1035,5 +1060,7 @@ namespace PKHeX.WinForms
private System.Windows.Forms.PictureBox P_InitialIcon;
private System.Windows.Forms.PictureBox P_CurrIcon;
private System.Windows.Forms.PictureBox P_CurrPhoto;
private System.Windows.Forms.Button B_UnlockClothing;
private System.Windows.Forms.ComboBox CB_Fashion;
}
}

View file

@ -43,6 +43,8 @@ public partial class SAV_Trainer9 : Form
GetTextBoxes();
LoadMap();
CB_Fashion.SelectedIndex = 0;
Loading = false;
}
@ -320,4 +322,19 @@ public partial class SAV_Trainer9 : Form
private void P_CurrPhoto_Click(object sender, EventArgs e) => IMG_Save(P_CurrPhoto.Image, "current_photo");
private void P_CurrIcon_Click(object sender, EventArgs e) => IMG_Save(P_CurrIcon.Image, "current_icon");
private void P_InitialIcon_Click(object sender, EventArgs e) => IMG_Save(P_InitialIcon.Image, "initial_icon");
private void B_UnlockClothing_Click(object sender, EventArgs e)
{
var accessor = SAV.Accessor;
var added = CB_Fashion.SelectedIndex switch
{
0 => PlayerFashionUnlock9.UnlockBase(accessor, SAV.Gender),
1 => PlayerFashionUnlock9.UnlockExtras(accessor),
2 => PlayerFashionUnlock9.UnlockPreorder(accessor, SAV.Gender),
3 => PlayerFashionUnlock9.UnlockPortal(accessor),
_ => throw new Exception("Invalid fashion type."),
};
WinFormsUtil.Alert(string.Format(MessageStrings.MsgClothingAdded, added));
System.Media.SystemSounds.Asterisk.Play();
}
}