diff --git a/Live/Kaeno-TraderScrolling/Kaeno-TraderScrolling.csproj b/Live/Kaeno-TraderScrolling/Kaeno-TraderScrolling.csproj index 25a02fe..ebb2374 100644 --- a/Live/Kaeno-TraderScrolling/Kaeno-TraderScrolling.csproj +++ b/Live/Kaeno-TraderScrolling/Kaeno-TraderScrolling.csproj @@ -1,36 +1,42 @@ - + net472 + + ..\..\..\..\SPT\BepInEx\core\0Harmony.dll + - ..\Shared\Aki.Reflection.dll + D:\SPT\EscapeFromTarkov_Data\Managed\Aki.Reflection.dll - ..\Shared\Assembly-CSharp.dll + D:\SPT\EscapeFromTarkov_Data\Managed\Assembly-CSharp.dll - ..\Shared\BepInEx.dll + D:\SPT\BepInEx\core\BepInEx.dll - ..\Shared\Comfort.dll + D:\SPT\EscapeFromTarkov_Data\Managed\Comfort.dll - ..\Shared\Newtonsoft.Json.dll + D:\SPT\EscapeFromTarkov_Data\Managed\Newtonsoft.Json.dll + + + ..\..\..\..\SPT\EscapeFromTarkov_Data\Managed\Sirenix.Serialization.dll - ..\Shared\UnityEngine.dll + D:\SPT\EscapeFromTarkov_Data\Managed\UnityEngine.dll - ..\Shared\UnityEngine.CoreModule.dll + D:\SPT\EscapeFromTarkov_Data\Managed\UnityEngine.CoreModule.dll - ..\Shared\UnityEngine.UI.dll + D:\SPT\EscapeFromTarkov_Data\Managed\UnityEngine.UI.dll - ..\Shared\UnityEngine.UIModule.dll + D:\SPT\EscapeFromTarkov_Data\Managed\UnityEngine.UIModule.dll diff --git a/Live/Kaeno-TraderScrolling/LICENSE b/Live/Kaeno-TraderScrolling/LICENSE new file mode 100644 index 0000000..80ff6e3 --- /dev/null +++ b/Live/Kaeno-TraderScrolling/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Naekami + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Live/Kaeno-TraderScrolling/PlayerCardScript.cs b/Live/Kaeno-TraderScrolling/PlayerCardScript.cs index 398ad92..40de5f7 100644 --- a/Live/Kaeno-TraderScrolling/PlayerCardScript.cs +++ b/Live/Kaeno-TraderScrolling/PlayerCardScript.cs @@ -13,7 +13,7 @@ namespace TraderScrolling var rightPerson = GameObject.Find("Right Person"); var list = rightPerson.GetComponentsInChildren(true).ToList(); var money = list.FirstOrDefault(x => x.name == "Money"); - var moneyRect = money.RectTransform(); + var moneyRect = money.GetComponent(); moneyRect.anchoredPosition = new Vector2(moneyRect.anchoredPosition.x + 60f, moneyRect.anchoredPosition.y); //End of Money position Change @@ -38,7 +38,8 @@ namespace TraderScrolling // Change Colour alpha to max for background var background = tile.FirstOrDefault(x => x.name == "Background"); - background.color = new Color(0, 0, 0, 1); + background.color = new Color(0, 0, 0, 1); + } } } diff --git a/Live/Kaeno-TraderScrolling/TraderScrolling.cs b/Live/Kaeno-TraderScrolling/TraderScrolling.cs index c8e3bcf..992be84 100644 --- a/Live/Kaeno-TraderScrolling/TraderScrolling.cs +++ b/Live/Kaeno-TraderScrolling/TraderScrolling.cs @@ -2,13 +2,13 @@ namespace TraderScrolling { - [BepInPlugin("com.kaeno.TraderScrolling", "Kaeno-TraderScrolling", "1.0.0")] + [BepInPlugin("com.kaeno.TraderScrolling", "Kaeno-TraderScrolling", "1.0.2")] public class TraderScrolling : BaseUnityPlugin { private void Awake() { new TraderScrollingPatch().Enable(); new PlayerCardPatch().Enable(); - } + } } } diff --git a/Live/Kaeno-TraderScrolling/TraderScrollingPatch.cs b/Live/Kaeno-TraderScrolling/TraderScrollingPatch.cs index c5253de..a0ff9f7 100644 --- a/Live/Kaeno-TraderScrolling/TraderScrollingPatch.cs +++ b/Live/Kaeno-TraderScrolling/TraderScrollingPatch.cs @@ -2,6 +2,7 @@ using Aki.Reflection.Patching; using Aki.Reflection.Utils; using EFT.UI; +using HarmonyLib; using UnityEngine; namespace TraderScrolling @@ -10,7 +11,7 @@ namespace TraderScrolling { protected override MethodBase GetTargetMethod() { - return typeof(TraderScreensGroup).GetMethod("method_4", PatchConstants.PrivateFlags); + return AccessTools.Method(typeof(TraderScreensGroup), nameof(TraderScreensGroup.Show)); } [PatchPostfix] @@ -18,12 +19,12 @@ namespace TraderScrolling { var gameObject = GameObject.Find("Menu UI"); var check = gameObject.GetComponentInChildren(); - + + if (check != null) { return; } - gameObject.AddComponent(); } } diff --git a/Live/Kaeno-TraderScrolling/TraderScrollingScript.cs b/Live/Kaeno-TraderScrolling/TraderScrollingScript.cs index 094a9f9..307cf82 100644 --- a/Live/Kaeno-TraderScrolling/TraderScrollingScript.cs +++ b/Live/Kaeno-TraderScrolling/TraderScrollingScript.cs @@ -1,4 +1,6 @@ -using System.Linq; +using Comfort.Common; +using EFT.UI; +using System.Linq; using UnityEngine; using UnityEngine.UI; @@ -13,10 +15,10 @@ namespace TraderScrolling var list = menuUI.GetComponentsInChildren(true).ToList(); var container = list.FirstOrDefault(x => x.name == "Container"); var scrollrect = traderCards.AddComponent(); - var traderCardsRect = traderCards.RectTransform(); - var containerRect = container.RectTransform(); + var traderCardsRect = traderCards.GetComponent(); + var containerRect = container.GetComponent(); - var countCards = traderCards.transform.childCount; + var countCards = traderCards.transform.childCount; var count = countCards - 10; //THIS IS DEFAULT anchorMin For anything below 11 @@ -35,6 +37,6 @@ namespace TraderScrolling scrollrect.vertical = false; scrollrect.movementType = ScrollRect.MovementType.Elastic; scrollrect.viewport = containerRect; - } + } } }