Allow click correcting Gender icon

This commit is contained in:
Kurt
2022-12-17 14:04:22 -08:00
parent 1de869f541
commit ee9f8f0558
2 changed files with 10 additions and 3 deletions

View File

@@ -110,6 +110,7 @@ internal static int GetMaxSpeciesOrigin(PKM pk)
PA8 pa8 => !pa8.LA,
PB8 pb8 => !pb8.BDSP,
PK8 pk8 => pk8.IsSideTransfer || pk8.BattleVersion != 0,
PK9 pk9 => !pk9.SV,
_ => false,
};
@@ -129,7 +130,7 @@ public static bool IsPPUpAvailable(PKM pk)
public static bool IsPPUpAvailable(ushort moveID) => moveID switch
{
0 => false,
(int)Move.Sketch => false,
(int)Move.Sketch => false, // BD/SP v1.0 could use PP Ups on Sketch, but not in later versions. Disallow anyways.
(int)Move.RevivalBlessing => false,
_ => true,
};

View File

@@ -567,12 +567,18 @@ private void ClickLevel(object sender, EventArgs e)
private void ClickGender(object sender, EventArgs e)
{
if (!Entity.PersonalInfo.IsDualGender)
var pi = Entity.PersonalInfo;
if (!pi.IsDualGender)
{
var expect = pi.FixedGender();
if (UC_Gender.Gender != expect)
UC_Gender.Gender = expect;
return; // can't toggle
}
var (canToggle, gender) = UC_Gender.ToggleGender();
if (!canToggle)
return;
gender = UC_Gender.Gender = 0; // fix bad genders
if (Entity.Format <= 2)
{
Stats.SetATKIVGender(gender);