mirror of
https://github.com/kwsch/NHSE.git
synced 2026-04-29 10:06:58 -05:00
10_0000th bit of Flag0 is to indicate if an item was dropped rather than placed (dropped clothing vs clothing on display) treat dropped items and buried item sizes as 2x2 (1.0x1.0) rather than their placed sizes
33 lines
1020 B
C#
33 lines
1020 B
C#
namespace NHSE.Core
|
|
{
|
|
public static class ItemInfo
|
|
{
|
|
private static readonly byte[] ItemKinds = ResourceUtil.GetBinaryResource("item_kind.bin");
|
|
private static readonly byte[] ItemSizes = ResourceUtil.GetBinaryResource("item_size.bin");
|
|
|
|
public static ItemKind GetItemKind(Item item) => GetItemKind(item.DisplayItemId);
|
|
|
|
public static ItemKind GetItemKind(ushort id)
|
|
{
|
|
if (id > ItemKinds.Length)
|
|
return FieldItemList.GetFieldItemKind(id);
|
|
return (ItemKind) ItemKinds[id];
|
|
}
|
|
|
|
public static ItemSizeType GetItemSize(Item item)
|
|
{
|
|
if (item.IsBuried || item.IsDropped)
|
|
return ItemSizeType.S_1_0x1_0;
|
|
|
|
return GetItemSize(item.DisplayItemId);
|
|
}
|
|
|
|
public static ItemSizeType GetItemSize(ushort id)
|
|
{
|
|
if (id > ItemSizes.Length)
|
|
return ItemSizeType.Unknown;
|
|
return (ItemSizeType)ItemSizes[id];
|
|
}
|
|
}
|
|
}
|