Some compatibility

This commit is contained in:
Ottermandias 2024-05-02 00:59:03 +02:00
parent 9d18707cb7
commit 8fff09f92e
3 changed files with 32 additions and 30 deletions

View file

@ -82,7 +82,9 @@ public unsafe class ModelEvaluationPanel(
ImGuiUtil.DrawTableColumn("Scale"); ImGuiUtil.DrawTableColumn("Scale");
ImGuiUtil.DrawTableColumn(actor.Valid ? actor.AsObject->Scale.ToString(CultureInfo.InvariantCulture) : "No Character"); ImGuiUtil.DrawTableColumn(actor.Valid ? actor.AsObject->Scale.ToString(CultureInfo.InvariantCulture) : "No Character");
ImGuiUtil.DrawTableColumn(model.Valid ? model.AsDrawObject->Object.Scale.ToString() : "No Model"); ImGuiUtil.DrawTableColumn(model.Valid ? model.AsDrawObject->Object.Scale.ToString() : "No Model");
ImGuiUtil.DrawTableColumn(model.IsCharacterBase ? $"{*(float*)(model.Address + 0x270)} {*(float*)(model.Address + 0x274)}" : "No CharacterBase"); ImGuiUtil.DrawTableColumn(model.IsCharacterBase
? $"{*(float*)(model.Address + 0x270)} {*(float*)(model.Address + 0x274)}"
: "No CharacterBase");
} }
private void DrawParameters(Actor actor, Model model) private void DrawParameters(Actor actor, Model model)
@ -229,7 +231,7 @@ public unsafe class ModelEvaluationPanel(
? *(CustomizeArray*)&actor.AsCharacter->DrawData.CustomizeData ? *(CustomizeArray*)&actor.AsCharacter->DrawData.CustomizeData
: new CustomizeArray(); : new CustomizeArray();
var modelCustomize = model.IsHuman var modelCustomize = model.IsHuman
? *(CustomizeArray*)model.AsHuman->Customize.Data ? *(CustomizeArray*)&model.AsHuman->Customize
: new CustomizeArray(); : new CustomizeArray();
foreach (var type in Enum.GetValues<CustomizeIndex>()) foreach (var type in Enum.GetValues<CustomizeIndex>())
{ {

View file

@ -73,18 +73,18 @@ public sealed unsafe class InventoryService : IDisposable, IRequiredService
} }
var plate = MirageManager.Instance()->GlamourPlatesSpan[glamourPlateId - 1]; var plate = MirageManager.Instance()->GlamourPlatesSpan[glamourPlateId - 1];
Add(EquipSlot.MainHand, plate.ItemIds[0], plate.StainIds[0], ref entry->MainHand); Add(EquipSlot.MainHand, plate.ItemIds[0], plate.StainIds[0], ref entry->ItemsSpan[0]);
Add(EquipSlot.OffHand, plate.ItemIds[1], plate.StainIds[10], ref entry->OffHand); Add(EquipSlot.OffHand, plate.ItemIds[1], plate.StainIds[1], ref entry->ItemsSpan[1]);
Add(EquipSlot.Head, plate.ItemIds[2], plate.StainIds[2], ref entry->Head); Add(EquipSlot.Head, plate.ItemIds[2], plate.StainIds[2], ref entry->ItemsSpan[2]);
Add(EquipSlot.Body, plate.ItemIds[3], plate.StainIds[3], ref entry->Body); Add(EquipSlot.Body, plate.ItemIds[3], plate.StainIds[3], ref entry->ItemsSpan[3]);
Add(EquipSlot.Hands, plate.ItemIds[4], plate.StainIds[4], ref entry->Hands); Add(EquipSlot.Hands, plate.ItemIds[4], plate.StainIds[4], ref entry->ItemsSpan[5]);
Add(EquipSlot.Legs, plate.ItemIds[5], plate.StainIds[5], ref entry->Legs); Add(EquipSlot.Legs, plate.ItemIds[5], plate.StainIds[5], ref entry->ItemsSpan[6]);
Add(EquipSlot.Feet, plate.ItemIds[6], plate.StainIds[6], ref entry->Feet); Add(EquipSlot.Feet, plate.ItemIds[6], plate.StainIds[6], ref entry->ItemsSpan[7]);
Add(EquipSlot.Ears, plate.ItemIds[7], plate.StainIds[7], ref entry->Ears); Add(EquipSlot.Ears, plate.ItemIds[7], plate.StainIds[7], ref entry->ItemsSpan[8]);
Add(EquipSlot.Neck, plate.ItemIds[8], plate.StainIds[8], ref entry->Neck); Add(EquipSlot.Neck, plate.ItemIds[8], plate.StainIds[8], ref entry->ItemsSpan[9]);
Add(EquipSlot.Wrists, plate.ItemIds[9], plate.StainIds[9], ref entry->Wrists); Add(EquipSlot.Wrists, plate.ItemIds[9], plate.StainIds[9], ref entry->ItemsSpan[10]);
Add(EquipSlot.RFinger, plate.ItemIds[10], plate.StainIds[10], ref entry->RingRight); Add(EquipSlot.RFinger, plate.ItemIds[10], plate.StainIds[10], ref entry->ItemsSpan[11]);
Add(EquipSlot.LFinger, plate.ItemIds[11], plate.StainIds[11], ref entry->RingLeft); Add(EquipSlot.LFinger, plate.ItemIds[11], plate.StainIds[11], ref entry->ItemsSpan[12]);
} }
else else
{ {
@ -98,18 +98,18 @@ public sealed unsafe class InventoryService : IDisposable, IRequiredService
_itemList.Add((slot, FixId(item.ItemID), item.Stain)); _itemList.Add((slot, FixId(item.ItemID), item.Stain));
} }
Add(EquipSlot.MainHand, ref entry->MainHand); Add(EquipSlot.MainHand, ref entry->ItemsSpan[0]);
Add(EquipSlot.OffHand, ref entry->OffHand); Add(EquipSlot.OffHand, ref entry->ItemsSpan[1]);
Add(EquipSlot.Head, ref entry->Head); Add(EquipSlot.Head, ref entry->ItemsSpan[2]);
Add(EquipSlot.Body, ref entry->Body); Add(EquipSlot.Body, ref entry->ItemsSpan[3]);
Add(EquipSlot.Hands, ref entry->Hands); Add(EquipSlot.Hands, ref entry->ItemsSpan[5]);
Add(EquipSlot.Legs, ref entry->Legs); Add(EquipSlot.Legs, ref entry->ItemsSpan[6]);
Add(EquipSlot.Feet, ref entry->Feet); Add(EquipSlot.Feet, ref entry->ItemsSpan[7]);
Add(EquipSlot.Ears, ref entry->Ears); Add(EquipSlot.Ears, ref entry->ItemsSpan[8]);
Add(EquipSlot.Neck, ref entry->Neck); Add(EquipSlot.Neck, ref entry->ItemsSpan[9]);
Add(EquipSlot.Wrists, ref entry->Wrists); Add(EquipSlot.Wrists, ref entry->ItemsSpan[10]);
Add(EquipSlot.RFinger, ref entry->RingRight); Add(EquipSlot.RFinger, ref entry->ItemsSpan[11]);
Add(EquipSlot.LFinger, ref entry->RingLeft); Add(EquipSlot.LFinger, ref entry->ItemsSpan[12]);
} }
_movedItemsEvent.Invoke(_itemList.ToArray()); _movedItemsEvent.Invoke(_itemList.ToArray());

View file

@ -136,9 +136,9 @@ public unsafe class ScalingService : IDisposable
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
private static void SetHeightCustomize(Character* character, byte gender, byte bodyType, byte clan, byte height) private static void SetHeightCustomize(Character* character, byte gender, byte bodyType, byte clan, byte height)
{ {
character->DrawData.CustomizeData.Sex = gender; character->DrawData.CustomizeData.Sex = gender;
character->DrawData.CustomizeData.BodyType = bodyType; character->DrawData.CustomizeData.BodyType = bodyType;
character->DrawData.CustomizeData.Tribe = clan; character->DrawData.CustomizeData.Tribe = clan;
character->DrawData.CustomizeData.Data[(int)CustomizeIndex.Height] = height; character->DrawData.CustomizeData.Height = height;
} }
} }