mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Some cleanup.
This commit is contained in:
parent
e716bbbc01
commit
21e6a17d1c
3 changed files with 2 additions and 74 deletions
|
|
@ -13,8 +13,7 @@ using Dalamud.Utility;
|
|||
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
||||
using Penumbra.GameData.Actors;
|
||||
using Action = Lumina.Excel.GeneratedSheets.Action;
|
||||
using ObjectType = Penumbra.GameData.Enums.ObjectType;
|
||||
|
||||
using ObjectType = Penumbra.GameData.Enums.ObjectType;
|
||||
namespace Penumbra.GameData.Data;
|
||||
|
||||
internal sealed class ObjectIdentification : DataSharer, IObjectIdentifier
|
||||
|
|
@ -96,75 +95,6 @@ internal sealed class ObjectIdentification : DataSharer, IObjectIdentifier
|
|||
return true;
|
||||
}
|
||||
|
||||
private static ulong EquipmentKey(Item i)
|
||||
{
|
||||
var model = (ulong)((Lumina.Data.Parsing.Quad)i.ModelMain).A;
|
||||
var variant = (ulong)((Lumina.Data.Parsing.Quad)i.ModelMain).B;
|
||||
var slot = (ulong)((EquipSlot)i.EquipSlotCategory.Row).ToSlot();
|
||||
return (model << 32) | (slot << 16) | variant;
|
||||
}
|
||||
|
||||
private static ulong WeaponKey(Item i, bool offhand)
|
||||
{
|
||||
var quad = offhand ? (Lumina.Data.Parsing.Quad)i.ModelSub : (Lumina.Data.Parsing.Quad)i.ModelMain;
|
||||
var model = (ulong)quad.A;
|
||||
var type = (ulong)quad.B;
|
||||
var variant = (ulong)quad.C;
|
||||
|
||||
return (model << 32) | (type << 16) | variant;
|
||||
}
|
||||
|
||||
private IReadOnlyList<(ulong Key, IReadOnlyList<Item> Values)> CreateWeaponList(DataManager gameData)
|
||||
{
|
||||
var items = gameData.GetExcelSheet<Item>(Language)!;
|
||||
var storage = new SortedList<ulong, HashSet<Item>>();
|
||||
foreach (var item in items.Where(i
|
||||
=> (EquipSlot)i.EquipSlotCategory.Row is EquipSlot.MainHand or EquipSlot.OffHand or EquipSlot.BothHand))
|
||||
{
|
||||
if (item.ModelMain != 0)
|
||||
Add(storage, WeaponKey(item, false), item);
|
||||
|
||||
if (item.ModelSub != 0)
|
||||
Add(storage, WeaponKey(item, true), item);
|
||||
}
|
||||
|
||||
return storage.Select(kvp => (kvp.Key, (IReadOnlyList<Item>)kvp.Value.ToArray())).ToList();
|
||||
}
|
||||
|
||||
private IReadOnlyList<(ulong Key, IReadOnlyList<Item> Values)> CreateEquipmentList(DataManager gameData)
|
||||
{
|
||||
var items = gameData.GetExcelSheet<Item>(Language)!;
|
||||
var storage = new SortedList<ulong, HashSet<Item>>();
|
||||
foreach (var item in items)
|
||||
{
|
||||
switch ((EquipSlot)item.EquipSlotCategory.Row)
|
||||
{
|
||||
// Accessories
|
||||
case EquipSlot.RFinger:
|
||||
case EquipSlot.Wrists:
|
||||
case EquipSlot.Ears:
|
||||
case EquipSlot.Neck:
|
||||
// Equipment
|
||||
case EquipSlot.Head:
|
||||
case EquipSlot.Body:
|
||||
case EquipSlot.Hands:
|
||||
case EquipSlot.Legs:
|
||||
case EquipSlot.Feet:
|
||||
case EquipSlot.BodyHands:
|
||||
case EquipSlot.BodyHandsLegsFeet:
|
||||
case EquipSlot.BodyLegsFeet:
|
||||
case EquipSlot.FullBody:
|
||||
case EquipSlot.HeadBody:
|
||||
case EquipSlot.LegsFeet:
|
||||
case EquipSlot.ChestHands:
|
||||
Add(storage, EquipmentKey(item), item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return storage.Select(kvp => (kvp.Key, (IReadOnlyList<Item>)kvp.Value.ToArray())).ToList();
|
||||
}
|
||||
|
||||
private IReadOnlyDictionary<string, IReadOnlyList<Action>> CreateActionList(DataManager gameData)
|
||||
{
|
||||
var sheet = gameData.GetExcelSheet<Action>(Language)!;
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
}
|
||||
}
|
||||
|
||||
public string GetCollectionForType( Enums.ApiCollectionType type )
|
||||
public string GetCollectionForType( ApiCollectionType type )
|
||||
{
|
||||
CheckInitialized();
|
||||
if( !Enum.IsDefined( type ) )
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Dalamud.Game.Text;
|
||||
using Dalamud.Game.Text.SeStringHandling;
|
||||
using Dalamud.Game.Text.SeStringHandling.Payloads;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Internal.Notifications;
|
||||
using Dalamud.Utility;
|
||||
using Lumina.Excel.GeneratedSheets;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue