mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Better fix for Lalafell and Elezen ears, maybe.
This commit is contained in:
parent
b8dad18f86
commit
550c0c756e
5 changed files with 82 additions and 25 deletions
|
|
@ -26,6 +26,7 @@ public class CharaMakeParams : ExcelRow
|
|||
Percentage = 5,
|
||||
Checkmark = 6, // custom
|
||||
Nothing = 7, // custom
|
||||
List1Selector = 8, // custom, 1-indexed lists
|
||||
}
|
||||
|
||||
public struct Menu
|
||||
|
|
|
|||
|
|
@ -293,7 +293,10 @@ public partial class CustomizationOptions
|
|||
var menu = row.Menus
|
||||
.Cast<CharaMakeParams.Menu?>()
|
||||
.FirstOrDefault(m => m!.Value.Customize == gameId);
|
||||
return menu?.Type ?? CharaMakeParams.MenuType.ListSelector;
|
||||
var ret = menu?.Type ?? CharaMakeParams.MenuType.ListSelector;
|
||||
if (c is CustomizeIndex.TailShape && ret is CharaMakeParams.MenuType.ListSelector)
|
||||
ret = CharaMakeParams.MenuType.List1Selector;
|
||||
return ret;
|
||||
}).ToArray();
|
||||
set.Order = CustomizationSet.ComputeOrder(set);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ public class CustomizationSet
|
|||
|
||||
custom = null;
|
||||
return value == CustomizeValue.Zero;
|
||||
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
|
|
@ -95,7 +94,7 @@ public class CustomizationSet
|
|||
{
|
||||
var type = Types[(int)index];
|
||||
|
||||
int GetInteger(out CustomizeData? custom)
|
||||
int GetInteger0(out CustomizeData? custom)
|
||||
{
|
||||
if (value < Count(index))
|
||||
{
|
||||
|
|
@ -107,6 +106,18 @@ public class CustomizationSet
|
|||
return -1;
|
||||
}
|
||||
|
||||
int GetInteger1(out CustomizeData? custom)
|
||||
{
|
||||
if (value > 0 && value < Count(index) + 1)
|
||||
{
|
||||
custom = new CustomizeData(index, value, 0, (ushort)(value.Value - 1));
|
||||
return value.Value;
|
||||
}
|
||||
|
||||
custom = null;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int GetBool(CustomizeIndex index, CustomizeValue value, out CustomizeData? custom)
|
||||
{
|
||||
if (value == CustomizeValue.Zero)
|
||||
|
|
@ -147,7 +158,8 @@ public class CustomizationSet
|
|||
|
||||
return type switch
|
||||
{
|
||||
CharaMakeParams.MenuType.ListSelector => GetInteger(out custom),
|
||||
CharaMakeParams.MenuType.ListSelector => GetInteger0(out custom),
|
||||
CharaMakeParams.MenuType.List1Selector => GetInteger1(out custom),
|
||||
CharaMakeParams.MenuType.IconSelector => index switch
|
||||
{
|
||||
CustomizeIndex.Face => Get(Faces, HrothgarFaceHack(value), out custom),
|
||||
|
|
@ -177,7 +189,7 @@ public class CustomizationSet
|
|||
_ => Invalid(out custom),
|
||||
},
|
||||
CharaMakeParams.MenuType.IconCheckmark => GetBool(index, value, out custom),
|
||||
CharaMakeParams.MenuType.Percentage => GetInteger(out custom),
|
||||
CharaMakeParams.MenuType.Percentage => GetInteger0(out custom),
|
||||
CharaMakeParams.MenuType.Checkmark => GetBool(index, value, out custom),
|
||||
_ => Invalid(out custom),
|
||||
};
|
||||
|
|
@ -195,9 +207,10 @@ public class CustomizationSet
|
|||
|
||||
switch (Types[(int)index])
|
||||
{
|
||||
case CharaMakeParams.MenuType.Percentage: return new CustomizeData(index, (CustomizeValue)idx, 0, (ushort)idx);
|
||||
case CharaMakeParams.MenuType.ListSelector: return new CustomizeData(index, (CustomizeValue)idx, 0, (ushort)idx);
|
||||
case CharaMakeParams.MenuType.Checkmark: return new CustomizeData(index, CustomizeValue.Bool(idx != 0), 0, (ushort)idx);
|
||||
case CharaMakeParams.MenuType.Percentage: return new CustomizeData(index, (CustomizeValue)idx, 0, (ushort)idx);
|
||||
case CharaMakeParams.MenuType.ListSelector: return new CustomizeData(index, (CustomizeValue)idx, 0, (ushort)idx);
|
||||
case CharaMakeParams.MenuType.List1Selector: return new CustomizeData(index, (CustomizeValue)(idx + 1), 0, (ushort)idx);
|
||||
case CharaMakeParams.MenuType.Checkmark: return new CustomizeData(index, CustomizeValue.Bool(idx != 0), 0, (ushort)idx);
|
||||
}
|
||||
|
||||
return index switch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue