Skip to content

Commit

Permalink
[MO] Fix buttons double loading coords in h scenes; Don't include tem…
Browse files Browse the repository at this point in the history
…plate in KKS since it's unused
  • Loading branch information
ManlyMarco committed Oct 9, 2021
1 parent 4fcf961 commit 9c70f95
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/MoreOutfits.Core/MoreOutfits.Core.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,4 @@
<Compile Include="$(MSBuildThisFileDirectory)MoreOutfits.UI.Maker.cs" />
<Compile Include="$(MSBuildThisFileDirectory)MoreOutfits.UI.Studio.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Resources\ListTemplate.png" />
</ItemGroup>
</Project>
9 changes: 7 additions & 2 deletions src/MoreOutfits.Core/MoreOutfits.UI.HScene.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.IO;
using System.Linq;
using System.Reflection;
using KKAPI.Utilities;
using TMPro;
using UniRx;
using UnityEngine;
Expand All @@ -12,15 +13,16 @@ namespace KK_Plugins.MoreOutfits
internal static class HSceneUI
{
internal static bool HSceneUIInitialized = false;
private static Sprite ListTemplate;

internal static void InitializeHSceneUI()
{
if (HSceneUIInitialized)
return;
HSceneUIInitialized = true;

#if KK // Not needed in KKS
LoadListTemplate();
#endif

var hSceneProc = Object.FindObjectOfType<HSceneProc>();

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -155,6 +157,8 @@ private static T CopyComponent<T>(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"))
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/MoreOutfits.Core/MoreOutfits.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/MoreOutfits.KK/KK.MoreOutfits.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
<Analyzer Include="..\..\packages\KoikatuCompatibilityAnalyzer.1.0.1\analyzers\dotnet\cs\KoikatuCompatibilityAnalyzer.dll" />
<Analyzer Include="..\..\packages\Microsoft.Unity.Analyzers.1.11.0\analyzers\dotnet\cs\Microsoft.Unity.Analyzers.dll" />
</ItemGroup>
<ItemGroup>
<Content Include="Resources\ListTemplate.png" />
</ItemGroup>
<Import Project="..\MoreOutfits.Core\MoreOutfits.Core.projitems" Label="Shared" />
<Import Project="..\Shared\Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down

0 comments on commit 9c70f95

Please sign in to comment.