Update API 9 and add data to items.

This commit is contained in:
Ottermandias 2023-10-02 16:56:24 +02:00
parent c98ed04bf3
commit cb0da11529
62 changed files with 524 additions and 268 deletions

View file

@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Numerics;
using Dalamud.Interface;
using Dalamud.Interface.Components;
using Dalamud.Interface.Utility;
using Dalamud.Plugin.Services;
using Glamourer.Designs;
using Glamourer.Events;
@ -47,18 +47,18 @@ public class EquipmentDrawer
_gPose = gPose;
_stainData = items.Stains;
_stainCombo = new FilterComboColors(DefaultWidth - 20,
_stainData.Data.Prepend(new KeyValuePair<byte, (string Name, uint Dye, bool Gloss)>(0, ("None", 0, false))));
_itemCombo = EquipSlotExtensions.EqdpSlots.Select(e => new ItemCombo(gameData, items, e)).ToArray();
_stainData.Data.Prepend(new KeyValuePair<byte, (string Name, uint Dye, bool Gloss)>(0, ("None", 0, false))), Glamourer.Log);
_itemCombo = EquipSlotExtensions.EqdpSlots.Select(e => new ItemCombo(gameData, items, e, Glamourer.Log)).ToArray();
_weaponCombo = new Dictionary<FullEquipType, WeaponCombo>(FullEquipTypeExtensions.WeaponTypes.Count * 2);
foreach (var type in Enum.GetValues<FullEquipType>())
{
if (type.ToSlot() is EquipSlot.MainHand)
_weaponCombo.TryAdd(type, new WeaponCombo(items, type));
_weaponCombo.TryAdd(type, new WeaponCombo(items, type, Glamourer.Log));
else if (type.ToSlot() is EquipSlot.OffHand)
_weaponCombo.TryAdd(type, new WeaponCombo(items, type));
_weaponCombo.TryAdd(type, new WeaponCombo(items, type, Glamourer.Log));
}
_weaponCombo.Add(FullEquipType.Unknown, new WeaponCombo(items, FullEquipType.Unknown));
_weaponCombo.Add(FullEquipType.Unknown, new WeaponCombo(items, FullEquipType.Unknown, Glamourer.Log));
}
private Vector2 _iconSize;

View file

@ -6,6 +6,7 @@ using ImGuiNET;
using Lumina.Excel.GeneratedSheets;
using OtterGui;
using OtterGui.Classes;
using OtterGui.Log;
using OtterGui.Raii;
using OtterGui.Widgets;
using Penumbra.GameData.Enums;
@ -19,8 +20,8 @@ public sealed class ItemCombo : FilterComboCache<EquipItem>
private ItemId _currentItem;
private float _innerWidth;
public ItemCombo(IDataManager gameData, ItemManager items, EquipSlot slot)
: base(() => GetItems(items, slot))
public ItemCombo(IDataManager gameData, ItemManager items, EquipSlot slot, Logger log)
: base(() => GetItems(items, slot), log)
{
Label = GetLabel(gameData, slot);
_currentItem = ItemManager.NothingId(slot);

View file

@ -5,6 +5,7 @@ using Glamourer.Services;
using ImGuiNET;
using OtterGui;
using OtterGui.Classes;
using OtterGui.Log;
using OtterGui.Raii;
using OtterGui.Widgets;
using Penumbra.GameData.Enums;
@ -18,8 +19,8 @@ public sealed class WeaponCombo : FilterComboCache<EquipItem>
private ItemId _currentItemId;
private float _innerWidth;
public WeaponCombo(ItemManager items, FullEquipType type)
: base(() => GetWeapons(items, type))
public WeaponCombo(ItemManager items, FullEquipType type, Logger log)
: base(() => GetWeapons(items, type), log)
{
Label = GetLabel(type);
SearchByParts = true;