muffin v7.5.6
This commit is contained in:
parent
6266f9e6b7
commit
addf2d530f
619 changed files with 264792 additions and 446022 deletions
207
LLib/LLib.Inventory/ItemHandle.cs
Normal file
207
LLib/LLib.Inventory/ItemHandle.cs
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game;
|
||||
using Lumina.Excel.Sheets;
|
||||
|
||||
namespace LLib.Inventory;
|
||||
|
||||
public readonly record struct ItemHandle(uint RawId)
|
||||
{
|
||||
public uint Id
|
||||
{
|
||||
get
|
||||
{
|
||||
int num = ((RawId >= 1000000) ? 357166028 : 357166029);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 357166028;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 2:
|
||||
goto IL_004b;
|
||||
case 1:
|
||||
return RawId;
|
||||
case 0:
|
||||
return RawId % 1000000;
|
||||
}
|
||||
continue;
|
||||
IL_004b:
|
||||
num = 357166029;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsHq => RawId >= 1000000;
|
||||
|
||||
private const uint HqThreshold = 1000000u;
|
||||
|
||||
public static implicit operator ItemHandle(uint itemId)
|
||||
{
|
||||
return new ItemHandle(itemId);
|
||||
}
|
||||
|
||||
public static ItemHandle FromUInt32(uint itemId)
|
||||
{
|
||||
return new ItemHandle(itemId);
|
||||
}
|
||||
|
||||
public static implicit operator uint(ItemHandle handle)
|
||||
{
|
||||
return handle.Id;
|
||||
}
|
||||
|
||||
public uint ToUInt32()
|
||||
{
|
||||
return Id;
|
||||
}
|
||||
|
||||
public unsafe static ItemHandle FromInventorySlot(InventoryItem* slot)
|
||||
{
|
||||
int num = ((slot != null) ? (-1287272070) : (-1287272069));
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = -1287272070;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 2:
|
||||
goto IL_0043;
|
||||
case 0:
|
||||
return new ItemHandle(slot->ItemId);
|
||||
case 1:
|
||||
return new ItemHandle(0u);
|
||||
}
|
||||
continue;
|
||||
IL_0043:
|
||||
num = -1287272069;
|
||||
}
|
||||
}
|
||||
|
||||
public unsafe int GetCount(bool checkEquipped = false, bool checkArmory = false)
|
||||
{
|
||||
InventoryManager* ptr = InventoryManager.Instance();
|
||||
int num = ((ptr != null) ? 991214794 : 991214795);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 991214794;
|
||||
int num4 = num2;
|
||||
switch ((num4 | num3) - (num4 & num3))
|
||||
{
|
||||
case 2:
|
||||
goto IL_0049;
|
||||
case 0:
|
||||
return ptr->GetInventoryItemCount(Id, isHq: false, checkEquipped, checkArmory, 0) + ptr->GetInventoryItemCount(Id, isHq: true, checkEquipped, checkArmory, 0);
|
||||
case 1:
|
||||
return 0;
|
||||
}
|
||||
continue;
|
||||
IL_0049:
|
||||
num = 991214795;
|
||||
}
|
||||
}
|
||||
|
||||
public int GetCountInContainer(InventoryType container)
|
||||
{
|
||||
return InventoryHelper.GetItemCount(Id, container);
|
||||
}
|
||||
|
||||
public int CountInContainers(ReadOnlySpan<InventoryType> containers)
|
||||
{
|
||||
return InventoryContainers.CountItems(Id, containers);
|
||||
}
|
||||
|
||||
public bool HasItem(bool checkEquipped = false, bool checkArmory = false)
|
||||
{
|
||||
return GetCount(checkEquipped, checkArmory) > 0;
|
||||
}
|
||||
|
||||
public bool IsEquipped()
|
||||
{
|
||||
return InventoryHelper.IsItemEquipped(Id);
|
||||
}
|
||||
|
||||
public int GetEquippedSlot()
|
||||
{
|
||||
return InventoryHelper.GetEquippedItemSlot(Id);
|
||||
}
|
||||
|
||||
public Item? GetRow(IDataManager dataManager)
|
||||
{
|
||||
return dataManager.GetExcelSheet<Item>().GetRowOrDefault(Id);
|
||||
}
|
||||
|
||||
public uint GetItemLevel(IDataManager dataManager)
|
||||
{
|
||||
return GetRow(dataManager)?.LevelItem.RowId ?? 0;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
[CompilerGenerated]
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder stringBuilder = _206E_206E_206A_200B_206C_200B_202B_202B_200C_206E_206F_206C_206C_202A_200B_200B_200C_206D_206F_200E_206A_200E_202A_202B_206A_206D_200C_200E_206D_200D_202A_202D_206A_206C_200F_200C_206C_200F_202E_206E_202E();
|
||||
_200F_206B_200D_200E_206E_206A_206E_200F_206F_200C_200E_206E_206D_200E_200B_202C_202D_202E_200F_206D_202D_200C_206E_200D_206B_206D_206F_206A_200F_206E_202E_202A_206A_200B_200C_206C_206F_206B_200D_202A_202E(stringBuilder, global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(29412539));
|
||||
_200F_206B_200D_200E_206E_206A_206E_200F_206F_200C_200E_206E_206D_200E_200B_202C_202D_202E_200F_206D_202D_200C_206E_200D_206B_206D_206F_206A_200F_206E_202E_202A_206A_200B_200C_206C_206F_206B_200D_202A_202E(stringBuilder, global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(1808631505));
|
||||
int num = ((!PrintMembers(stringBuilder)) ? 631534302 : 631534303);
|
||||
while (true)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 631534302;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 2:
|
||||
num = 631534303;
|
||||
break;
|
||||
case 1:
|
||||
_202C_200E_202D_200E_200E_200C_202C_206A_206B_206D_202C_206B_200E_200C_200E_202D_202D_206F_206B_206B_202A_200E_202E_206A_202B_206C_206E_200C_200F_206B_200B_200C_202A_200C_202E_200E_200E_206B_200C_206C_202E(stringBuilder, ' ');
|
||||
num = 631534302;
|
||||
break;
|
||||
case 0:
|
||||
_202C_200E_202D_200E_200E_200C_202C_206A_206B_206D_202C_206B_200E_200C_200E_202D_202D_206F_206B_206B_202A_200E_202E_206A_202B_206C_206E_200C_200F_206B_200B_200C_202A_200C_202E_200E_200E_206B_200C_206C_202E(stringBuilder, '}');
|
||||
return _200B_202B_206F_200F_200E_202E_206C_202B_206E_200B_206C_200B_202E_202E_206C_206F_206D_206A_202A_206B_206C_202B_200B_200C_206C_200F_202E_202B_200E_200B_202A_200D_200E_206F_200C_200F_202B_206B_206C_206E_202E((object)stringBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
[CompilerGenerated]
|
||||
private bool PrintMembers(StringBuilder builder)
|
||||
{
|
||||
_200F_206B_200D_200E_206E_206A_206E_200F_206F_200C_200E_206E_206D_200E_200B_202C_202D_202E_200F_206D_202D_200C_206E_200D_206B_206D_206F_206A_200F_206E_202E_202A_206A_200B_200C_206C_206F_206B_200D_202A_202E(builder, global::_003CModule_003E._206A_202C_200C_206F_202A_200C_200F_206F_202B_202B_200D_206F_206D_200E_206A_206B_202A_200F_200B_206C_202B_202A_202B_206C_200F_206C_202C_202C_200C_206C_206F_200C_200B_202D_200E_202A_202A_206B_206B_200F_202E<string>(-595664961));
|
||||
_200F_206B_200D_200E_206E_206A_206E_200F_206F_200C_200E_206E_206D_200E_200B_202C_202D_202E_200F_206D_202D_200C_206E_200D_206B_206D_206F_206A_200F_206E_202E_202A_206A_200B_200C_206C_206F_206B_200D_202A_202E(builder, RawId.ToString());
|
||||
_200F_206B_200D_200E_206E_206A_206E_200F_206F_200C_200E_206E_206D_200E_200B_202C_202D_202E_200F_206D_202D_200C_206E_200D_206B_206D_206F_206A_200F_206E_202E_202A_206A_200B_200C_206C_206F_206B_200D_202A_202E(builder, global::_003CModule_003E._206E_202B_206C_202A_202A_200E_202B_202B_206D_200B_200C_206B_200B_206D_202E_202D_206C_202B_200B_206A_202D_206C_202A_200F_202D_200C_200B_200B_200B_200D_202C_206E_206D_202E_200C_206B_206A_206D_202D_202C_202E<string>(-1970731150));
|
||||
_200F_206B_200D_200E_206E_206A_206E_200F_206F_200C_200E_206E_206D_200E_200B_202C_202D_202E_200F_206D_202D_200C_206E_200D_206B_206D_206F_206A_200F_206E_202E_202A_206A_200B_200C_206C_206F_206B_200D_202A_202E(builder, Id.ToString());
|
||||
_200F_206B_200D_200E_206E_206A_206E_200F_206F_200C_200E_206E_206D_200E_200B_202C_202D_202E_200F_206D_202D_200C_206E_200D_206B_206D_206F_206A_200F_206E_202E_202A_206A_200B_200C_206C_206F_206B_200D_202A_202E(builder, global::_003CModule_003E._202E_202C_206D_206B_202B_202D_206D_202E_206F_202E_202A_206A_206A_202B_206A_202D_202C_206C_206B_202C_206E_202B_200E_206E_206A_206C_200D_200D_200F_200B_202C_200B_200E_206F_202C_200F_202D_202A_206E_202B_202E<string>(1700323707));
|
||||
_200F_206B_200D_200E_206E_206A_206E_200F_206F_200C_200E_206E_206D_200E_200B_202C_202D_202E_200F_206D_202D_200C_206E_200D_206B_206D_206F_206A_200F_206E_202E_202A_206A_200B_200C_206C_206F_206B_200D_202A_202E(builder, IsHq.ToString());
|
||||
return true;
|
||||
}
|
||||
|
||||
static StringBuilder _206E_206E_206A_200B_206C_200B_202B_202B_200C_206E_206F_206C_206C_202A_200B_200B_200C_206D_206F_200E_206A_200E_202A_202B_206A_206D_200C_200E_206D_200D_202A_202D_206A_206C_200F_200C_206C_200F_202E_206E_202E()
|
||||
{
|
||||
return new StringBuilder();
|
||||
}
|
||||
|
||||
static StringBuilder _200F_206B_200D_200E_206E_206A_206E_200F_206F_200C_200E_206E_206D_200E_200B_202C_202D_202E_200F_206D_202D_200C_206E_200D_206B_206D_206F_206A_200F_206E_202E_202A_206A_200B_200C_206C_206F_206B_200D_202A_202E(StringBuilder P_0, string P_1)
|
||||
{
|
||||
return P_0.Append(P_1);
|
||||
}
|
||||
|
||||
static StringBuilder _202C_200E_202D_200E_200E_200C_202C_206A_206B_206D_202C_206B_200E_200C_200E_202D_202D_206F_206B_206B_202A_200E_202E_206A_202B_206C_206E_200C_200F_206B_200B_200C_202A_200C_202E_200E_200E_206B_200C_206C_202E(StringBuilder P_0, char P_1)
|
||||
{
|
||||
return P_0.Append(P_1);
|
||||
}
|
||||
|
||||
static string _200B_202B_206F_200F_200E_202E_206C_202B_206E_200B_206C_200B_202E_202E_206C_206F_206D_206A_202A_206B_206C_202B_200B_200C_206C_200F_202E_202B_200E_200B_202A_200D_200E_206F_200C_200F_202B_206B_206C_206E_202E(object P_0)
|
||||
{
|
||||
return P_0.ToString();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue