mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-25 16:35:02 -05:00
* Update to .NET 10 * Property fields * API signature updates * Extension method blocks * Completed dark mode support Outside of my control: - vertical tab control (pkm editor) - datetimepicker controls - lgpe event flags (no idea) - some control types having white-borders when they should really be gray Box background is 50% transparency to effectively darken the image. * Custom legality report popup * Event diff dialog, version select dialog * Add quick overwrite popup for export sav * Extension methods * Dark Mode: glow currently editing sprite * Add invalid encounter hint for trade evolutions * Extension properties * Append legality hint on hover card * Slot image loading: clear the screen-reader description if a slot is empty/invalid, rather than retain the previous description. Changing boxes would easily confuse users on this.
54 lines
1.9 KiB
C#
54 lines
1.9 KiB
C#
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Lumped image type.
|
|
/// </summary>
|
|
public enum HeldItemLumpImage
|
|
{
|
|
/// <summary>
|
|
/// Held Item sprite is a specific held item.
|
|
/// </summary>
|
|
NotLump = 0,
|
|
|
|
/// <summary>
|
|
/// Held Item sprite should show the Technical Machine (TM) icon.
|
|
/// </summary>
|
|
TechnicalMachine,
|
|
|
|
/// <summary>
|
|
/// Held Item sprite should show the Technical Record (TR) icon.
|
|
/// </summary>
|
|
TechnicalRecord,
|
|
}
|
|
|
|
/// <summary>
|
|
/// Logic to check if a held item should show a lumped image sprite.
|
|
/// </summary>
|
|
public static class HeldItemLumpUtil
|
|
{
|
|
/// <summary>
|
|
/// Checks if the <see cref="image"/> is a lumped sprite.
|
|
/// </summary>
|
|
/// <param name="image">Evaluated type</param>
|
|
/// <returns>True if the <see cref="image"/> is a lumped sprite.</returns>
|
|
public static bool IsLump(this HeldItemLumpImage image) => image != HeldItemLumpImage.NotLump;
|
|
|
|
/// <summary>
|
|
/// Checks if the <see cref="item"/> should show a lumped sprite.
|
|
/// </summary>
|
|
/// <param name="item">Held Item index</param>
|
|
/// <param name="context">Generation context</param>
|
|
/// <returns>Evaluation result.</returns>
|
|
public static HeldItemLumpImage GetIsLump(int item, EntityContext context) => context.Generation switch
|
|
{
|
|
<= 4 when item is (>= 0328 and <= 0419) => HeldItemLumpImage.TechnicalMachine, // Gen2/3/4 TM
|
|
8 when item is (>= 0328 and <= 0427) => HeldItemLumpImage.TechnicalMachine, // BD/SP TMs
|
|
8 when item is (>= 1130 and <= 1229) => HeldItemLumpImage.TechnicalRecord, // Gen8 TR
|
|
9 when item is (>= 0328 and <= 0419) // TM01-TM92
|
|
or (>= 0618 and <= 0620) // TM093-TM095
|
|
or (>= 0690 and <= 0693) // TM096-TM099
|
|
or (>= 2160 and <= 2289) /* TM100-TM229 */ => HeldItemLumpImage.TechnicalMachine,
|
|
_ => HeldItemLumpImage.NotLump,
|
|
};
|
|
}
|