From 4fcf961c8c2f6a90bbfbe45877a424ba6795fb21 Mon Sep 17 00:00:00 2001 From: k7a <3d1tmd@gmail.com> Date: Sat, 9 Oct 2021 23:38:25 +0900 Subject: [PATCH] [MO] [KKS] HScene support (#109) Add Outfits change button for KKS HScene --- src/MoreOutfits.Core/MoreOutfits.UI.HScene.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/MoreOutfits.Core/MoreOutfits.UI.HScene.cs b/src/MoreOutfits.Core/MoreOutfits.UI.HScene.cs index ecb39e6f..fdeef116 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 TMPro; using UniRx; using UnityEngine; using UnityEngine.UI; @@ -27,11 +28,19 @@ internal static void InitializeHSceneUI() { foreach (var button in hSceneProc.sprite.categoryDress.lstButton) { +#if KK if (button != null && button.gameObject.name == "ChangeCoordinatType") { var parent = button.transform.Find("CoordinatGroup/CoordinatCategory"); SetUpList(hSceneProc, parent, 0); } +#elif KKS + if (button != null && button.gameObject.transform.parent.name == "ChangeCoordinatType") + { + var parent = button.transform.parent.Find("CoordinatGroup/CoordinatCategory"); + SetUpList(hSceneProc, parent, 0); + } +#endif } } else //Multi girl H @@ -62,12 +71,21 @@ private static void SetUpList(HSceneProc hSceneProc, Transform parent, int femal var viewportPos = scroll.viewport.localPosition; scroll.viewport.localPosition = new Vector3(0f, viewportPos.y, viewportPos.z); +#if KK var copyTarget = GameObject.Find("Canvas").transform.Find("clothesFileWindow/Window/WinRect/ListArea/Scroll View/Scrollbar Vertical").gameObject; +#elif KKS + var copyTarget = Object.FindObjectOfType().transform.Find("clothesFileWindow/Window/WinRect/ListArea/Scroll View/Scrollbar Vertical").gameObject; +#endif + var newScrollbar = Object.Instantiate(copyTarget, go.transform); scroll.verticalScrollbar = newScrollbar.GetComponent(); newScrollbar.transform.SetRect(1f, 0f, 1f, 1f, 0f, 0f, 18f); var newScrollbarPos = newScrollbar.transform.localPosition; +#if KK newScrollbar.transform.localPosition = new Vector3(135f, newScrollbarPos.y, newScrollbarPos.z); +#elif KKS + newScrollbar.transform.localPosition = new Vector3(170f, newScrollbarPos.y, newScrollbarPos.z); +#endif var vlg = parent.GetComponent(); var csf = parent.GetComponent(); @@ -86,6 +104,7 @@ private static void SetUpList(HSceneProc hSceneProc, Transform parent, int femal newButton.onClick.RemoveAllListeners(); newButton.onClick.AddListener(() => hSceneProc.sprite.OnClickCoordinateChange(femaleIndex, coordinateIndex)); +#if KK //Set the sprite to one without text var buttonImage = newButton.GetComponent(); buttonImage.sprite = ListTemplate; @@ -109,6 +128,10 @@ private static void SetUpList(HSceneProc hSceneProc, Transform parent, int femal buttonText.horizontalOverflow = HorizontalWrapMode.Wrap; buttonText.verticalOverflow = VerticalWrapMode.Overflow; buttonText.color = Color.black; +#elif KKS + var textContainer = newButton.GetComponentInChildren(); + textContainer.text = GetCoodinateName(chaControl, coordinateIndex); +#endif } }