mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Fix some issues with customization IDs and supported counts.
This commit is contained in:
parent
47b5895404
commit
68b68d6ce7
4 changed files with 16 additions and 5 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8e57c2e12570bb1795efb9e5c6e38617aa8dd5e3
|
Subproject commit b15c0f07ba270a7b6a350411006e003da9818d1b
|
||||||
|
|
@ -5,6 +5,7 @@ using Penumbra.GameData.Data;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.GameData.Structs;
|
using Penumbra.GameData.Structs;
|
||||||
using Penumbra.Interop.Structs;
|
using Penumbra.Interop.Structs;
|
||||||
|
using Penumbra.Meta.Files;
|
||||||
|
|
||||||
namespace Penumbra.Meta.Manipulations;
|
namespace Penumbra.Meta.Manipulations;
|
||||||
|
|
||||||
|
|
@ -98,6 +99,12 @@ public readonly record struct ShpIdentifier(HumanSlot Slot, PrimaryId? Id, Shape
|
||||||
if (Slot is HumanSlot.Unknown && Id is not null)
|
if (Slot is HumanSlot.Unknown && Id is not null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (Slot.ToSpecificEnum() is BodySlot && Id is { Id: > byte.MaxValue })
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (Id is { Id: > ExpandedEqpGmpBase.Count - 1 })
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!ValidateCustomShapeString(Shape))
|
if (!ValidateCustomShapeString(Shape))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ public class ShapeManager : IRequiredService, IDisposable
|
||||||
if (model is null || model->ModelResourceHandle is null)
|
if (model is null || model->ModelResourceHandle is null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
_ids[(int)modelIndex] = human.GetArmorChanged(modelIndex).Set;
|
_ids[(int)modelIndex] = human.GetModelId(modelIndex);
|
||||||
|
|
||||||
ref var shapes = ref model->ModelResourceHandle->Shapes;
|
ref var shapes = ref model->ModelResourceHandle->Shapes;
|
||||||
foreach (var (shape, index) in shapes.Where(kvp => ShpIdentifier.ValidateCustomShapeString(kvp.Key.Value)))
|
foreach (var (shape, index) in shapes.Where(kvp => ShpIdentifier.ValidateCustomShapeString(kvp.Key.Value)))
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ using OtterGui.Raii;
|
||||||
using OtterGui.Services;
|
using OtterGui.Services;
|
||||||
using OtterGui.Text;
|
using OtterGui.Text;
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
|
using Penumbra.GameData.Structs;
|
||||||
using Penumbra.Meta;
|
using Penumbra.Meta;
|
||||||
using Penumbra.Meta.Files;
|
using Penumbra.Meta.Files;
|
||||||
using Penumbra.Meta.Manipulations;
|
using Penumbra.Meta.Manipulations;
|
||||||
|
|
@ -151,9 +152,8 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IdInput("##shpPrimaryId"u8, unscaledWidth, identifier.Id.GetValueOrDefault(0).Id, out var setId, 0,
|
var max = identifier.Slot.ToSpecificEnum() is BodySlot ? byte.MaxValue : ExpandedEqpGmpBase.Count - 1;
|
||||||
ExpandedEqpGmpBase.Count - 1,
|
if (IdInput("##shpPrimaryId"u8, unscaledWidth, identifier.Id.GetValueOrDefault(0).Id, out var setId, 0, max, false))
|
||||||
false))
|
|
||||||
{
|
{
|
||||||
identifier = identifier with { Id = setId };
|
identifier = identifier with { Id = setId };
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
@ -190,6 +190,10 @@ public sealed class ShpMetaDrawer(ModMetaEditor editor, MetaFileManager metaFile
|
||||||
{
|
{
|
||||||
identifier = identifier with
|
identifier = identifier with
|
||||||
{
|
{
|
||||||
|
Id = identifier.Id.HasValue
|
||||||
|
? (PrimaryId)Math.Clamp(identifier.Id.Value.Id, 0,
|
||||||
|
slot.ToSpecificEnum() is BodySlot ? byte.MaxValue : ExpandedEqpGmpBase.Count - 1)
|
||||||
|
: null,
|
||||||
Slot = slot,
|
Slot = slot,
|
||||||
ConnectorCondition = Identifier.ConnectorCondition switch
|
ConnectorCondition = Identifier.ConnectorCondition switch
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue