From 9c70f95aadcf9905d9518f30a3d5bcd422392ed8 Mon Sep 17 00:00:00 2001 From: ManlyMarco <39247311+ManlyMarco@users.noreply.github.com> Date: Sat, 9 Oct 2021 17:07:08 +0200 Subject: [PATCH] [MO] Fix buttons double loading coords in h scenes; Don't include template in KKS since it's unused --- src/MoreOutfits.Core/MoreOutfits.Core.projitems | 3 --- src/MoreOutfits.Core/MoreOutfits.UI.HScene.cs | 9 +++++++-- src/MoreOutfits.Core/MoreOutfits.cs | 2 +- src/MoreOutfits.KK/KK.MoreOutfits.csproj | 3 +++ .../Resources/ListTemplate.png | Bin 5 files changed, 11 insertions(+), 6 deletions(-) rename src/{MoreOutfits.Core => MoreOutfits.KK}/Resources/ListTemplate.png (100%) diff --git a/src/MoreOutfits.Core/MoreOutfits.Core.projitems b/src/MoreOutfits.Core/MoreOutfits.Core.projitems index f2fd8fb2..27461d23 100644 --- a/src/MoreOutfits.Core/MoreOutfits.Core.projitems +++ b/src/MoreOutfits.Core/MoreOutfits.Core.projitems @@ -17,7 +17,4 @@ - - - \ No newline at end of file diff --git a/src/MoreOutfits.Core/MoreOutfits.UI.HScene.cs b/src/MoreOutfits.Core/MoreOutfits.UI.HScene.cs index fdeef116..b8a8bdba 100644 --- a/src/MoreOutfits.Core/MoreOutfits.UI.HScene.cs +++ b/src/MoreOutfits.Core/MoreOutfits.UI.HScene.cs @@ -1,6 +1,7 @@ using System.IO; using System.Linq; using System.Reflection; +using KKAPI.Utilities; using TMPro; using UniRx; using UnityEngine; @@ -12,7 +13,6 @@ namespace KK_Plugins.MoreOutfits internal static class HSceneUI { internal static bool HSceneUIInitialized = false; - private static Sprite ListTemplate; internal static void InitializeHSceneUI() { @@ -20,7 +20,9 @@ internal static void InitializeHSceneUI() return; HSceneUIInitialized = true; +#if KK // Not needed in KKS LoadListTemplate(); +#endif var hSceneProc = Object.FindObjectOfType(); @@ -101,7 +103,7 @@ private static void SetUpList(HSceneProc hSceneProc, Transform parent, int femal { int coordinateIndex = OriginalCoordinateLength + i; var newButton = Object.Instantiate(buttons[0], buttons[0].transform.parent); - newButton.onClick.RemoveAllListeners(); + newButton.onClick.ActuallyRemoveAllListeners(); newButton.onClick.AddListener(() => hSceneProc.sprite.OnClickCoordinateChange(femaleIndex, coordinateIndex)); #if KK @@ -155,6 +157,8 @@ private static T CopyComponent(T original, GameObject destination) where T : return dst; } +#if KK // Not needed in KKS + private static Sprite ListTemplate; internal static void LoadListTemplate() { using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream($"KK_Plugins.Resources.ListTemplate.png")) @@ -167,6 +171,7 @@ internal static void LoadListTemplate() ListTemplate = Sprite.Create(texture2D, new Rect(0f, 0f, 112, 24), new Vector2(112, 24)); } } +#endif } internal static class Extensions diff --git a/src/MoreOutfits.Core/MoreOutfits.cs b/src/MoreOutfits.Core/MoreOutfits.cs index 593d85bb..7ff29861 100644 --- a/src/MoreOutfits.Core/MoreOutfits.cs +++ b/src/MoreOutfits.Core/MoreOutfits.cs @@ -15,7 +15,7 @@ public class Plugin : BaseUnityPlugin public const string PluginGUID = "com.deathweasel.bepinex.moreoutfits"; public const string PluginName = "More Outfit Slots"; public const string PluginNameInternal = Constants.Prefix + "_MoreOutfits"; - public const string PluginVersion = "1.0.2"; + public const string PluginVersion = "1.1"; internal static new ManualLogSource Logger; internal static Plugin Instance; diff --git a/src/MoreOutfits.KK/KK.MoreOutfits.csproj b/src/MoreOutfits.KK/KK.MoreOutfits.csproj index 2f3f4d23..6f9c2324 100644 --- a/src/MoreOutfits.KK/KK.MoreOutfits.csproj +++ b/src/MoreOutfits.KK/KK.MoreOutfits.csproj @@ -91,6 +91,9 @@ + + + diff --git a/src/MoreOutfits.Core/Resources/ListTemplate.png b/src/MoreOutfits.KK/Resources/ListTemplate.png similarity index 100% rename from src/MoreOutfits.Core/Resources/ListTemplate.png rename to src/MoreOutfits.KK/Resources/ListTemplate.png