diff --git a/Glamourer/GameData/CustomizeSet.cs b/Glamourer/GameData/CustomizeSet.cs index d2dc8e9..bc4e7a3 100644 --- a/Glamourer/GameData/CustomizeSet.cs +++ b/Glamourer/GameData/CustomizeSet.cs @@ -248,19 +248,6 @@ public class CustomizeSet public CharaMakeParams.MenuType Type(CustomizeIndex index) => Types[(int)index]; - internal static IReadOnlyDictionary ComputeOrder(CustomizeSet set) - { - var ret = Enum.GetValues().ToArray(); - ret[(int)CustomizeIndex.TattooColor] = CustomizeIndex.EyeColorLeft; - ret[(int)CustomizeIndex.EyeColorLeft] = CustomizeIndex.EyeColorRight; - ret[(int)CustomizeIndex.EyeColorRight] = CustomizeIndex.TattooColor; - - var dict = ret.Skip(2).Where(set.IsAvailable).GroupBy(set.Type).ToDictionary(k => k.Key, k => k.ToArray()); - foreach (var type in Enum.GetValues()) - dict.TryAdd(type, Array.Empty()); - return dict; - } - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] public int Count(CustomizeIndex index) => Count(index, CustomizeValue.Zero); diff --git a/Glamourer/GameData/CustomizeSetFactory.cs b/Glamourer/GameData/CustomizeSetFactory.cs index 6099344..22d465b 100644 --- a/Glamourer/GameData/CustomizeSetFactory.cs +++ b/Glamourer/GameData/CustomizeSetFactory.cs @@ -68,6 +68,7 @@ internal class CustomizeSetFactory( SetFacialFeatures(set, row); SetHairByFace(set); SetNpcData(set, set.Clan, set.Gender); + SetOrder(set); } /// Given a customize set with filled data, find all customizations used by valid NPCs that are not regularly available. @@ -303,7 +304,7 @@ internal class CustomizeSetFactory( } /// Get the manu types for all available options. - private CharaMakeParams.MenuType[] GetMenuTypes(CharaMakeParams row) + private static CharaMakeParams.MenuType[] GetMenuTypes(CharaMakeParams row) { // Set up the menu types for all customizations. return Enum.GetValues().Select(c => @@ -394,6 +395,19 @@ internal class CustomizeSetFactory( } } + internal static void SetOrder(CustomizeSet set) + { + var ret = Enum.GetValues().ToArray(); + ret[(int)CustomizeIndex.TattooColor] = CustomizeIndex.EyeColorLeft; + ret[(int)CustomizeIndex.EyeColorLeft] = CustomizeIndex.EyeColorRight; + ret[(int)CustomizeIndex.EyeColorRight] = CustomizeIndex.TattooColor; + + var dict = ret.Skip(2).Where(set.IsAvailable).GroupBy(set.Type).ToDictionary(k => k.Key, k => k.ToArray()); + foreach (var type in Enum.GetValues()) + dict.TryAdd(type, []); + set.Order = dict; + } + /// Set hairstyles per face for Hrothgar and make it simple for non-Hrothgar. private void SetHairByFace(CustomizeSet set) {