mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Allow for unlockable facepaints.
This commit is contained in:
parent
a8020c5a76
commit
f9442067c8
1 changed files with 22 additions and 5 deletions
|
|
@ -102,10 +102,27 @@ namespace Glamourer.Customization
|
||||||
return menu?.Size ?? 0;
|
return menu?.Size ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Customization[] GetFacePaints(CharaMakeParams row)
|
private Customization[] GetFacePaints(SubRace race, Gender gender)
|
||||||
=> row.Menus.Cast<CharaMakeParams.Menu?>().FirstOrDefault(m => m!.Value.Customization == CustomizationId.FacePaint)?.Values
|
{
|
||||||
.Select((v, i) => FromValueAndIndex(CustomizationId.FacePaint, v, i)).ToArray()
|
var row = _hairSheet.GetRow(((uint)race - 1) * 2 - 1 + (uint)gender)!;
|
||||||
?? Array.Empty<Customization>();
|
var paintList = new List<Customization>(row.Unknown37);
|
||||||
|
for (var i = 0; i < row.Unknown37; ++i)
|
||||||
|
{
|
||||||
|
var name = $"Unknown{73 + i * 9}";
|
||||||
|
var customizeIdx =
|
||||||
|
(uint?)row.GetType().GetProperty(name, BindingFlags.Public | BindingFlags.Instance)?.GetValue(row)
|
||||||
|
?? uint.MaxValue;
|
||||||
|
if (customizeIdx == uint.MaxValue)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var paintRow = _customizeSheet.GetRow(customizeIdx);
|
||||||
|
paintList.Add(paintRow != null
|
||||||
|
? new Customization(CustomizationId.FacePaint, paintRow.FeatureID, paintRow.Icon, (ushort)paintRow.RowId)
|
||||||
|
: new Customization(CustomizationId.FacePaint, (byte)i, customizeIdx, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
return paintList.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
private Customization[] GetTailEarShapes(CharaMakeParams row)
|
private Customization[] GetTailEarShapes(CharaMakeParams row)
|
||||||
=> row.Menus.Cast<CharaMakeParams.Menu?>().FirstOrDefault(m => m!.Value.Customization == CustomizationId.TailEarShape)?.Values
|
=> row.Menus.Cast<CharaMakeParams.Menu?>().FirstOrDefault(m => m!.Value.Customization == CustomizationId.TailEarShape)?.Values
|
||||||
|
|
@ -149,7 +166,7 @@ namespace Glamourer.Customization
|
||||||
NumNoseShapes = GetListSize(row, CustomizationId.Nose),
|
NumNoseShapes = GetListSize(row, CustomizationId.Nose),
|
||||||
NumJawShapes = GetListSize(row, CustomizationId.Jaw),
|
NumJawShapes = GetListSize(row, CustomizationId.Jaw),
|
||||||
NumMouthShapes = GetListSize(row, CustomizationId.Mouth),
|
NumMouthShapes = GetListSize(row, CustomizationId.Mouth),
|
||||||
FacePaints = GetFacePaints(row),
|
FacePaints = GetFacePaints(race, gender),
|
||||||
TailEarShapes = GetTailEarShapes(row),
|
TailEarShapes = GetTailEarShapes(row),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue