This commit is contained in:
Ottermandias 2023-01-31 17:45:42 +01:00
parent 33c2ed7903
commit e27a194cc6
47 changed files with 2037 additions and 1167 deletions

View file

@ -47,6 +47,8 @@ public enum CustomizeFlag : ulong
public static class CustomizeFlagExtensions
{
public const CustomizeFlag All = (CustomizeFlag)(((ulong)CustomizeFlag.FacePaintColor << 1) - 1ul);
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
public static CustomizeIndex ToIndex(this CustomizeFlag flag)
=> flag switch
@ -87,6 +89,6 @@ public static class CustomizeFlagExtensions
CustomizeFlag.FacePaint => CustomizeIndex.FacePaint,
CustomizeFlag.FacePaintReversed => CustomizeIndex.FacePaintReversed,
CustomizeFlag.FacePaintColor => CustomizeIndex.FacePaintColor,
_ => (CustomizeIndex) byte.MaxValue,
_ => (CustomizeIndex)byte.MaxValue,
};
}

View file

@ -6,30 +6,29 @@ using Dalamud.Data;
using Glamourer.Structs;
using Lumina.Excel.GeneratedSheets;
using Penumbra.GameData.Enums;
using Item = Glamourer.Structs.Item;
namespace Glamourer;
public static class GameData
{
private static Dictionary<EquipSlot, List<Item>>? _itemsBySlot;
private static Dictionary<EquipSlot, List<Item2>>? _itemsBySlot;
private static Dictionary<byte, Job>? _jobs;
private static Dictionary<ushort, JobGroup>? _jobGroups;
public static IReadOnlyDictionary<EquipSlot, List<Item>> ItemsBySlot(DataManager dataManager)
public static IReadOnlyDictionary<EquipSlot, List<Item2>> ItemsBySlot(DataManager dataManager)
{
if (_itemsBySlot != null)
return _itemsBySlot;
var sheet = dataManager.GetExcelSheet<Lumina.Excel.GeneratedSheets.Item>()!;
Item EmptySlot(EquipSlot slot)
Item2 EmptySlot(EquipSlot slot)
=> new(sheet.First(), "Nothing", slot);
static Item EmptyNpc(EquipSlot slot)
static Item2 EmptyNpc(EquipSlot slot)
=> new(new Lumina.Excel.GeneratedSheets.Item() { ModelMain = 9903 }, "Smallclothes (NPC)", slot);
_itemsBySlot = new Dictionary<EquipSlot, List<Item>>()
_itemsBySlot = new Dictionary<EquipSlot, List<Item2>>()
{
[EquipSlot.Head] = new(200)
{
@ -93,7 +92,7 @@ public static class GameData
if (slot == EquipSlot.OffHand)
slot = EquipSlot.MainHand;
if (_itemsBySlot.TryGetValue(slot, out var list))
list.Add(new Item(item, name, slot));
list.Add(new Item2(item, name, slot));
}
foreach (var list in _itemsBySlot.Values)

View file

@ -0,0 +1,34 @@
namespace Glamourer;
public static class Offsets
{
public static class Character
{
public const int ClassJobContainer = 0x1A8;
public const int Wetness = 0x1ADA;
public const int HatVisible = 0x84E;
public const int VisorToggled = 0x84F;
public const int WeaponHidden1 = 0x84F;
public const int WeaponHidden2 = 0x72C;
public const int Alpha = 0x19E0;
public static class Flags
{
public const byte IsHatHidden = 0x01;
public const byte IsVisorToggled = 0x08;
public const byte IsWet = 0x80;
public const byte IsWeaponHidden1 = 0x01;
public const byte IsWeaponHidden2 = 0x02;
}
}
public const byte DrawObjectVisorStateFlag = 0x40;
public const byte DrawObjectVisorToggleFlag = 0x80;
}
public static class Sigs
{
public const string ChangeJob = "88 51 ?? 44 3B CA";
public const string FlagSlotForUpdate = "48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC 20 8B DA 49 8B F0 48 8B F9 83 FA 0A";
}

View file

@ -4,7 +4,7 @@ using Penumbra.GameData.Structs;
namespace Glamourer.Structs;
// An Item wrapper struct that contains the item table, a precomputed name and the associated equip slot.
public readonly struct Item
public readonly struct Item2
{
public readonly Lumina.Excel.GeneratedSheets.Item Base;
public readonly string Name;
@ -28,7 +28,7 @@ public readonly struct Item
=> ((WeaponCategory) (Base.ItemUICategory?.Row ?? 0)).ToEquipType();
// Create a new item from its sheet list with the given name and either the inferred equip slot or the given one.
public Item(Lumina.Excel.GeneratedSheets.Item item, string name, EquipSlot slot = EquipSlot.Unknown)
public Item2(Lumina.Excel.GeneratedSheets.Item item, string name, EquipSlot slot = EquipSlot.Unknown)
{
Base = item;
Name = name;
@ -36,7 +36,7 @@ public readonly struct Item
}
// Create empty Nothing items.
public static Item Nothing(EquipSlot slot)
public static Item2 Nothing(EquipSlot slot)
=> new("Nothing", slot);
// Produce the relevant model information for a given item and equip slot.
@ -58,7 +58,7 @@ public readonly struct Item
}
// Used for 'Nothing' items.
private Item(string name, EquipSlot slot)
private Item2(string name, EquipSlot slot)
{
Name = name;
Base = new Lumina.Excel.GeneratedSheets.Item();