From d0b89cbaa03b9a403894c97ee26c190954359eb5 Mon Sep 17 00:00:00 2001 From: jalil <63772680+jalil49@users.noreply.github.com> Date: Sun, 14 Mar 2021 21:59:09 -0500 Subject: [PATCH] Fixed Coordinate Load ME support Added function to coordinate load for when main feature is off --- src/CharaEvent.cs | 23 +++++++++++++++++++++-- src/ClothingLoader.cs | 2 -- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/CharaEvent.cs b/src/CharaEvent.cs index 7ebfb70..48c261e 100644 --- a/src/CharaEvent.cs +++ b/src/CharaEvent.cs @@ -936,6 +936,13 @@ protected override void OnCoordinateBeingLoaded(ChaFileCoordinate coordinate) if (TextureQueue.Peek() != null && TextureQueue.Peek().ObjectType != ObjectType.Unknown) { MaterialTextureProperty ME_Info = TextureQueue.Dequeue(); + if (!ThisOutfitData.ME_Work && ME_Info.TexID != null) + { + if (ThisOutfitData.importDictionaryQueue[ME_Info.CoordinateIndex].TryGetValue((int)ME_Info.TexID, out byte[] imgbyte)) + { + ME_Info.TexID = ME_Support.SetAndGetTextureID(imgbyte); + } + } ME_Info.Slot = ACCpostion; MaterialTexture.Add(ME_Info); } @@ -1042,8 +1049,13 @@ protected override void OnCoordinateBeingLoaded(ChaFileCoordinate coordinate) if (TextureQueue.Peek() != null && TextureQueue.Peek().ObjectType != ObjectType.Unknown) { MaterialTextureProperty ME_Info = TextureQueue.Dequeue(); - ME_Info.Slot = ACCpostion; - + if (!ThisOutfitData.ME_Work && ME_Info.TexID != null) + { + if (ThisOutfitData.importDictionaryQueue[ME_Info.CoordinateIndex].TryGetValue((int)ME_Info.TexID, out byte[] imgbyte)) + { + ME_Info.TexID = ME_Support.SetAndGetTextureID(imgbyte); + } + } ME_Info.Slot = ACCpostion; MaterialTexture.Add(ME_Info); } @@ -1147,6 +1159,13 @@ protected override void OnCoordinateBeingLoaded(ChaFileCoordinate coordinate) if (TextureQueue.Peek() != null && TextureQueue.Peek().ObjectType != ObjectType.Unknown) { MaterialTextureProperty ME_Info = TextureQueue.Dequeue(); + if (!ThisOutfitData.ME_Work && ME_Info.TexID != null) + { + if (ThisOutfitData.importDictionaryQueue[ME_Info.CoordinateIndex].TryGetValue((int)ME_Info.TexID, out byte[] imgbyte)) + { + ME_Info.TexID = ME_Support.SetAndGetTextureID(imgbyte); + } + } ME_Info.Slot = ACCpostion; MaterialTexture.Add(ME_Info); } diff --git a/src/ClothingLoader.cs b/src/ClothingLoader.cs index d42957f..fa4b1c9 100644 --- a/src/ClothingLoader.cs +++ b/src/ClothingLoader.cs @@ -358,8 +358,6 @@ private void GeneralizedLoad(int outfitnum) ME_Info.TexID = ME_Support.SetAndGetTextureID(imgbyte); } } - ME_Info.Slot = ACCpostion; - ME_Info.Slot = ACCpostion; MaterialTexture.Add(ME_Info); }