Fix some issues with left rings.

This commit is contained in:
Ottermandias 2023-07-15 15:03:44 +02:00
parent be8ad5b5e5
commit 4743914153
3 changed files with 10 additions and 9 deletions

View file

@ -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<CharaMakeParams.MenuType> Types { get; internal set; } = null!;
public IReadOnlyDictionary<CharaMakeParams.MenuType, CustomizeIndex[]> Order { get; internal set; } = null!;
public IReadOnlyList<byte> Voices { get; internal init; } = null!;
public IReadOnlyList<CharaMakeParams.MenuType> Types { get; internal set; } = null!;
public IReadOnlyDictionary<CharaMakeParams.MenuType, CustomizeIndex[]> Order { get; internal set; } = null!;
// Always list selector.
@ -77,7 +77,6 @@ public class CustomizationSet
public IReadOnlyList<CustomizeData> LipColorsLight { get; internal init; } = null!;
public IReadOnlyList<CustomizeData> 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,

View file

@ -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)

View file

@ -240,7 +240,7 @@ public class StateManager : IReadOnlyDictionary<ActorIdentifier, ActorState>
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<ActorIdentifier, ActorState>
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);