From 8fff09f92ebbbee6ea9dc5814767e57ce829b76a Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Thu, 2 May 2024 00:59:03 +0200 Subject: [PATCH] Some compatibility --- .../Gui/Tabs/DebugTab/ModelEvaluationPanel.cs | 6 ++- Glamourer/Interop/InventoryService.cs | 48 +++++++++---------- Glamourer/Interop/ScalingService.cs | 8 ++-- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/Glamourer/Gui/Tabs/DebugTab/ModelEvaluationPanel.cs b/Glamourer/Gui/Tabs/DebugTab/ModelEvaluationPanel.cs index 566ad52..c557064 100644 --- a/Glamourer/Gui/Tabs/DebugTab/ModelEvaluationPanel.cs +++ b/Glamourer/Gui/Tabs/DebugTab/ModelEvaluationPanel.cs @@ -82,7 +82,9 @@ public unsafe class ModelEvaluationPanel( ImGuiUtil.DrawTableColumn("Scale"); 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.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) @@ -229,7 +231,7 @@ public unsafe class ModelEvaluationPanel( ? *(CustomizeArray*)&actor.AsCharacter->DrawData.CustomizeData : new CustomizeArray(); var modelCustomize = model.IsHuman - ? *(CustomizeArray*)model.AsHuman->Customize.Data + ? *(CustomizeArray*)&model.AsHuman->Customize : new CustomizeArray(); foreach (var type in Enum.GetValues()) { diff --git a/Glamourer/Interop/InventoryService.cs b/Glamourer/Interop/InventoryService.cs index 6871ed9..9ad8737 100644 --- a/Glamourer/Interop/InventoryService.cs +++ b/Glamourer/Interop/InventoryService.cs @@ -73,18 +73,18 @@ public sealed unsafe class InventoryService : IDisposable, IRequiredService } var plate = MirageManager.Instance()->GlamourPlatesSpan[glamourPlateId - 1]; - Add(EquipSlot.MainHand, plate.ItemIds[0], plate.StainIds[0], ref entry->MainHand); - Add(EquipSlot.OffHand, plate.ItemIds[1], plate.StainIds[10], ref entry->OffHand); - Add(EquipSlot.Head, plate.ItemIds[2], plate.StainIds[2], ref entry->Head); - Add(EquipSlot.Body, plate.ItemIds[3], plate.StainIds[3], ref entry->Body); - Add(EquipSlot.Hands, plate.ItemIds[4], plate.StainIds[4], ref entry->Hands); - Add(EquipSlot.Legs, plate.ItemIds[5], plate.StainIds[5], ref entry->Legs); - Add(EquipSlot.Feet, plate.ItemIds[6], plate.StainIds[6], ref entry->Feet); - Add(EquipSlot.Ears, plate.ItemIds[7], plate.StainIds[7], ref entry->Ears); - Add(EquipSlot.Neck, plate.ItemIds[8], plate.StainIds[8], ref entry->Neck); - Add(EquipSlot.Wrists, plate.ItemIds[9], plate.StainIds[9], ref entry->Wrists); - Add(EquipSlot.RFinger, plate.ItemIds[10], plate.StainIds[10], ref entry->RingRight); - Add(EquipSlot.LFinger, plate.ItemIds[11], plate.StainIds[11], ref entry->RingLeft); + Add(EquipSlot.MainHand, plate.ItemIds[0], plate.StainIds[0], ref entry->ItemsSpan[0]); + Add(EquipSlot.OffHand, plate.ItemIds[1], plate.StainIds[1], ref entry->ItemsSpan[1]); + Add(EquipSlot.Head, plate.ItemIds[2], plate.StainIds[2], ref entry->ItemsSpan[2]); + Add(EquipSlot.Body, plate.ItemIds[3], plate.StainIds[3], ref entry->ItemsSpan[3]); + Add(EquipSlot.Hands, plate.ItemIds[4], plate.StainIds[4], ref entry->ItemsSpan[5]); + Add(EquipSlot.Legs, plate.ItemIds[5], plate.StainIds[5], ref entry->ItemsSpan[6]); + Add(EquipSlot.Feet, plate.ItemIds[6], plate.StainIds[6], ref entry->ItemsSpan[7]); + Add(EquipSlot.Ears, plate.ItemIds[7], plate.StainIds[7], ref entry->ItemsSpan[8]); + Add(EquipSlot.Neck, plate.ItemIds[8], plate.StainIds[8], ref entry->ItemsSpan[9]); + Add(EquipSlot.Wrists, plate.ItemIds[9], plate.StainIds[9], ref entry->ItemsSpan[10]); + Add(EquipSlot.RFinger, plate.ItemIds[10], plate.StainIds[10], ref entry->ItemsSpan[11]); + Add(EquipSlot.LFinger, plate.ItemIds[11], plate.StainIds[11], ref entry->ItemsSpan[12]); } else { @@ -98,18 +98,18 @@ public sealed unsafe class InventoryService : IDisposable, IRequiredService _itemList.Add((slot, FixId(item.ItemID), item.Stain)); } - Add(EquipSlot.MainHand, ref entry->MainHand); - Add(EquipSlot.OffHand, ref entry->OffHand); - Add(EquipSlot.Head, ref entry->Head); - Add(EquipSlot.Body, ref entry->Body); - Add(EquipSlot.Hands, ref entry->Hands); - Add(EquipSlot.Legs, ref entry->Legs); - Add(EquipSlot.Feet, ref entry->Feet); - Add(EquipSlot.Ears, ref entry->Ears); - Add(EquipSlot.Neck, ref entry->Neck); - Add(EquipSlot.Wrists, ref entry->Wrists); - Add(EquipSlot.RFinger, ref entry->RingRight); - Add(EquipSlot.LFinger, ref entry->RingLeft); + Add(EquipSlot.MainHand, ref entry->ItemsSpan[0]); + Add(EquipSlot.OffHand, ref entry->ItemsSpan[1]); + Add(EquipSlot.Head, ref entry->ItemsSpan[2]); + Add(EquipSlot.Body, ref entry->ItemsSpan[3]); + Add(EquipSlot.Hands, ref entry->ItemsSpan[5]); + Add(EquipSlot.Legs, ref entry->ItemsSpan[6]); + Add(EquipSlot.Feet, ref entry->ItemsSpan[7]); + Add(EquipSlot.Ears, ref entry->ItemsSpan[8]); + Add(EquipSlot.Neck, ref entry->ItemsSpan[9]); + Add(EquipSlot.Wrists, ref entry->ItemsSpan[10]); + Add(EquipSlot.RFinger, ref entry->ItemsSpan[11]); + Add(EquipSlot.LFinger, ref entry->ItemsSpan[12]); } _movedItemsEvent.Invoke(_itemList.ToArray()); diff --git a/Glamourer/Interop/ScalingService.cs b/Glamourer/Interop/ScalingService.cs index 1b55db2..66036d9 100644 --- a/Glamourer/Interop/ScalingService.cs +++ b/Glamourer/Interop/ScalingService.cs @@ -136,9 +136,9 @@ public unsafe class ScalingService : IDisposable [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] private static void SetHeightCustomize(Character* character, byte gender, byte bodyType, byte clan, byte height) { - character->DrawData.CustomizeData.Sex = gender; - character->DrawData.CustomizeData.BodyType = bodyType; - character->DrawData.CustomizeData.Tribe = clan; - character->DrawData.CustomizeData.Data[(int)CustomizeIndex.Height] = height; + character->DrawData.CustomizeData.Sex = gender; + character->DrawData.CustomizeData.BodyType = bodyType; + character->DrawData.CustomizeData.Tribe = clan; + character->DrawData.CustomizeData.Height = height; } }