From 47439141533bccc3fca594f2e90f570af2a3f0bf Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sat, 15 Jul 2023 15:03:44 +0200 Subject: [PATCH] Fix some issues with left rings. --- .../Customization/CustomizationSet.cs | 13 +++++++------ Glamourer/Services/ItemManager.cs | 2 +- Glamourer/State/StateManager.cs | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Glamourer.GameData/Customization/CustomizationSet.cs b/Glamourer.GameData/Customization/CustomizationSet.cs index c48b3c6..3207ab1 100644 --- a/Glamourer.GameData/Customization/CustomizationSet.cs +++ b/Glamourer.GameData/Customization/CustomizationSet.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; -using System.Xml.XPath; using OtterGui; using Penumbra.GameData.Enums; @@ -38,8 +37,9 @@ public class CustomizationSet public string Option(CustomizeIndex index) => OptionName[(int)index]; - public IReadOnlyList Types { get; internal set; } = null!; - public IReadOnlyDictionary Order { get; internal set; } = null!; + public IReadOnlyList Voices { get; internal init; } = null!; + public IReadOnlyList Types { get; internal set; } = null!; + public IReadOnlyDictionary Order { get; internal set; } = null!; // Always list selector. @@ -77,7 +77,6 @@ public class CustomizationSet public IReadOnlyList LipColorsLight { get; internal init; } = null!; public IReadOnlyList LipColorsDark { get; internal init; } = null!; - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] public int DataByValue(CustomizeIndex index, CustomizeValue value, out CustomizeData? custom, CustomizeValue face) { @@ -248,8 +247,10 @@ public class CustomizationSet CharaMakeParams.MenuType.Checkmark => 2, _ => index switch { - CustomizeIndex.Face => Faces.Count, - CustomizeIndex.Hairstyle => (face = HrothgarFaceHack(face)) < HairByFace.Count ? HairByFace[face.Value].Count : HairStyles.Count, + CustomizeIndex.Face => Faces.Count, + CustomizeIndex.Hairstyle => (face = HrothgarFaceHack(face)) < HairByFace.Count + ? HairByFace[face.Value].Count + : HairStyles.Count, CustomizeIndex.SkinColor => SkinColors.Count, CustomizeIndex.EyeColorRight => EyeColors.Count, CustomizeIndex.HairColor => HairColors.Count, diff --git a/Glamourer/Services/ItemManager.cs b/Glamourer/Services/ItemManager.cs index dee02d4..c0eeb6b 100644 --- a/Glamourer/Services/ItemManager.cs +++ b/Glamourer/Services/ItemManager.cs @@ -100,7 +100,7 @@ public class ItemManager : IDisposable public EquipItem Identify(EquipSlot slot, SetId id, byte variant) { slot = slot.ToSlot(); - if (!slot.IsEquipmentPiece()) + if (slot.ToIndex() == uint.MaxValue) return new EquipItem($"Invalid ({id.Value}-{variant})", 0, 0, id, 0, variant, 0); switch (id.Value) diff --git a/Glamourer/State/StateManager.cs b/Glamourer/State/StateManager.cs index c13e263..ec207e9 100644 --- a/Glamourer/State/StateManager.cs +++ b/Glamourer/State/StateManager.cs @@ -240,7 +240,7 @@ public class StateManager : IReadOnlyDictionary if (!_editor.ChangeItem(state, slot, item, source, out var old, key)) return; - var type = slot.IsEquipmentPiece() ? StateChanged.Type.Equip : StateChanged.Type.Weapon; + var type = slot.ToIndex() < 10 ? StateChanged.Type.Equip : StateChanged.Type.Weapon; var actors = type is StateChanged.Type.Equip ? _applier.ChangeArmor(state, slot, source is StateChanged.Source.Manual or StateChanged.Source.Ipc) : _applier.ChangeWeapon(state, slot, source is StateChanged.Source.Manual or StateChanged.Source.Ipc); @@ -255,7 +255,7 @@ public class StateManager : IReadOnlyDictionary if (!_editor.ChangeEquip(state, slot, item, stain, source, out var old, out var oldStain, key)) return; - var type = slot.IsEquipmentPiece() ? StateChanged.Type.Equip : StateChanged.Type.Weapon; + var type = slot.ToIndex() < 10 ? StateChanged.Type.Equip : StateChanged.Type.Weapon; var actors = type is StateChanged.Type.Equip ? _applier.ChangeArmor(state, slot, source is StateChanged.Source.Manual or StateChanged.Source.Ipc) : _applier.ChangeWeapon(state, slot, source is StateChanged.Source.Manual or StateChanged.Source.Ipc);