From d4ccd4c0081306f0af865e3b790d830cf1852730 Mon Sep 17 00:00:00 2001 From: ManlyMarco Date: Sat, 25 Sep 2021 13:27:59 +0200 Subject: [PATCH] Add KKS version; Clean up packages and references --- AI_QuickAccessBox/AI_QuickAccessBox.csproj | 66 ++++--- AI_QuickAccessBox/packages.config | 31 ++- HS2_QuickAccessBox/HS2_QuickAccessBox.csproj | 70 ++++--- HS2_QuickAccessBox/packages.config | 31 ++- KKS_QuickAccessBox/KKS_QuickAccessBox.csproj | 185 ++++++++++++++++++ KKS_QuickAccessBox/QuickAccessBox.cs | 7 + KKS_QuickAccessBox/packages.config | 20 ++ KK_QuickAccessBox/KK_QuickAccessBox.csproj | 28 +-- KK_QuickAccessBox/packages.config | 14 +- Shared_QuickAccessBox/ItemInfo.cs | 64 +++--- .../Shared_QuickAccessBox.projitems | 1 - Shared_QuickAccessBox/TranslationHelper.cs | 51 ----- Shared_QuickAccessBox/UI/InterfaceManager.cs | 2 +- Shared_QuickAccessBox/UI/MovableWindow.cs | 2 +- 14 files changed, 385 insertions(+), 187 deletions(-) create mode 100644 KKS_QuickAccessBox/KKS_QuickAccessBox.csproj create mode 100644 KKS_QuickAccessBox/QuickAccessBox.cs create mode 100644 KKS_QuickAccessBox/packages.config delete mode 100644 Shared_QuickAccessBox/TranslationHelper.cs diff --git a/AI_QuickAccessBox/AI_QuickAccessBox.csproj b/AI_QuickAccessBox/AI_QuickAccessBox.csproj index e7e5715..d1fdff7 100644 --- a/AI_QuickAccessBox/AI_QuickAccessBox.csproj +++ b/AI_QuickAccessBox/AI_QuickAccessBox.csproj @@ -45,23 +45,23 @@ False - ..\packages\ExtensibleSaveFormat.AIGirl.16.3.0\lib\net46\AI_ExtensibleSaveFormat.dll + ..\packages\ExtensibleSaveFormat.AIGirl.16.3.1\lib\net46\AI_ExtensibleSaveFormat.dll False - - ..\..\BepisPlugins\bin\BepInEx\plugins\AI_BepisPlugins\AI_Screencap.dll + + ..\packages\ScreenshotManager.AIGirl.16.3.1\lib\net46\AI_Screencap.dll False - ..\packages\Sideloader.AIGirl.16.0.0\lib\net46\AI_Sideloader.dll + ..\packages\Sideloader.AIGirl.16.3.1\lib\net46\AI_Sideloader.dll False - ..\packages\IllusionLibs.AIGirl.Assembly-CSharp.2020.5.29\lib\net46\Assembly-CSharp.dll + ..\packages\IllusionLibs.AIGirl.Assembly-CSharp.2020.5.29.4\lib\net46\Assembly-CSharp.dll False - ..\packages\IllusionLibs.AIGirl.Assembly-CSharp-firstpass.2020.5.29\lib\net35\Assembly-CSharp-firstpass.dll + ..\packages\IllusionLibs.AIGirl.Assembly-CSharp-firstpass.2020.5.29.4\lib\net46\Assembly-CSharp-firstpass.dll False @@ -69,57 +69,49 @@ False - ..\packages\IllusionLibs.AIGirl.Cinemachine.2018.2.21.1\lib\net46\Cinemachine.dll - False - - - ..\packages\SharpZipLib.1.2.0\lib\net45\ICSharpCode.SharpZipLib.dll + ..\packages\IllusionLibs.AIGirl.Cinemachine.2018.2.21.4\lib\net46\Cinemachine.dll False - ..\packages\IllusionLibs.AIGirl.MessagePack.2020.5.29\lib\net46\MessagePack.dll + ..\packages\IllusionLibs.AIGirl.MessagePack.2020.5.29.4\lib\net46\MessagePack.dll False - ..\packages\IllusionLibs.AIGirl.Sirenix.Serialization.2020.5.29\lib\net46\Sirenix.Serialization.dll + ..\packages\IllusionLibs.AIGirl.Sirenix.Serialization.2020.5.29.4\lib\net46\Sirenix.Serialization.dll False - ..\packages\IllusionLibs.AIGirl.UniRx.2020.5.29\lib\net46\UniRx.dll + ..\packages\IllusionLibs.AIGirl.UniRx.2020.5.29.4\lib\net46\UniRx.dll False - ..\packages\IllusionLibs.AIGirl.Unity.Postprocessing.Runtime.2018.2.21.1\lib\net46\Unity.Postprocessing.Runtime.dll + ..\packages\IllusionLibs.AIGirl.Unity.Postprocessing.Runtime.2018.2.21.4\lib\net46\Unity.Postprocessing.Runtime.dll False - ..\packages\IllusionLibs.AIGirl.Unity.TextMeshPro.2018.2.21.1\lib\net46\Unity.TextMeshPro.dll + ..\packages\IllusionLibs.AIGirl.Unity.TextMeshPro.2018.2.21.4\lib\net46\Unity.TextMeshPro.dll False - ..\packages\IllusionLibs.AIGirl.UnityEngine.CoreModule.2018.2.21.1\lib\net46\UnityEngine.dll + ..\packages\IllusionLibs.AIGirl.UnityEngine.CoreModule.2018.2.21.4\lib\net46\UnityEngine.dll False - ..\packages\IllusionLibs.AIGirl.UnityEngine.AssetBundleModule.2018.2.21.1\lib\net46\UnityEngine.AssetBundleModule.dll + ..\packages\IllusionLibs.AIGirl.UnityEngine.AssetBundleModule.2018.2.21.4\lib\net46\UnityEngine.AssetBundleModule.dll False - ..\packages\IllusionLibs.AIGirl.UnityEngine.CoreModule.2018.2.21.1\lib\net46\UnityEngine.CoreModule.dll + ..\packages\IllusionLibs.AIGirl.UnityEngine.CoreModule.2018.2.21.4\lib\net46\UnityEngine.CoreModule.dll False - ..\packages\IllusionLibs.AIGirl.UnityEngine.ImageConversionModule.2018.2.21.1\lib\net46\UnityEngine.ImageConversionModule.dll + ..\packages\IllusionLibs.AIGirl.UnityEngine.ImageConversionModule.2018.2.21.4\lib\net46\UnityEngine.ImageConversionModule.dll False - ..\packages\IllusionLibs.AIGirl.UnityEngine.UI.2018.2.21.1\lib\net46\UnityEngine.UI.dll - False - - - ..\packages\IllusionLibs.XUnity.AutoTranslator.Plugin.Core.4.11.3\lib\net46\XUnity.AutoTranslator.Plugin.Core.dll + ..\packages\IllusionLibs.AIGirl.UnityEngine.UI.2018.2.21.4\lib\net46\UnityEngine.UI.dll False @@ -145,5 +137,29 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AI_QuickAccessBox/packages.config b/AI_QuickAccessBox/packages.config index 2bdc0eb..5d4815f 100644 --- a/AI_QuickAccessBox/packages.config +++ b/AI_QuickAccessBox/packages.config @@ -1,22 +1,21 @@  - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + \ No newline at end of file diff --git a/HS2_QuickAccessBox/HS2_QuickAccessBox.csproj b/HS2_QuickAccessBox/HS2_QuickAccessBox.csproj index 48d195d..269db1b 100644 --- a/HS2_QuickAccessBox/HS2_QuickAccessBox.csproj +++ b/HS2_QuickAccessBox/HS2_QuickAccessBox.csproj @@ -41,11 +41,11 @@ False - ..\packages\IllusionLibs.HoneySelect2.Assembly-CSharp.2020.5.29\lib\net46\Assembly-CSharp.dll + ..\packages\IllusionLibs.HoneySelect2.Assembly-CSharp.2020.5.29.4\lib\net46\Assembly-CSharp.dll False - ..\packages\IllusionLibs.HoneySelect2.Assembly-CSharp-firstpass.2020.5.29\lib\net35\Assembly-CSharp-firstpass.dll + ..\packages\IllusionLibs.HoneySelect2.Assembly-CSharp-firstpass.2020.5.29.4\lib\net46\Assembly-CSharp-firstpass.dll False @@ -53,7 +53,7 @@ False - ..\packages\IllusionLibs.HoneySelect2.Cinemachine.2018.4.11\lib\net46\Cinemachine.dll + ..\packages\IllusionLibs.HoneySelect2.Cinemachine.2018.4.11.4\lib\net46\Cinemachine.dll False @@ -61,33 +61,29 @@ False - ..\packages\ExtensibleSaveFormat.HoneySelect2.16.3.0\lib\net46\HS2_ExtensibleSaveFormat.dll + ..\packages\ExtensibleSaveFormat.HoneySelect2.16.3.1\lib\net46\HS2_ExtensibleSaveFormat.dll False - - ..\..\BepisPlugins\bin\BepInEx\plugins\HS2_BepisPlugins\HS2_Screencap.dll + + ..\packages\ScreenshotManager.HoneySelect2.16.3.1\lib\net46\HS2_Screencap.dll False - ..\packages\Sideloader.HoneySelect2.16.0.0\lib\net46\HS2_Sideloader.dll - False - - - ..\packages\SharpZipLib.1.2.0\lib\net45\ICSharpCode.SharpZipLib.dll + ..\packages\Sideloader.HoneySelect2.16.3.1\lib\net46\HS2_Sideloader.dll False - ..\packages\IllusionLibs.HoneySelect2.IL.2020.5.29\lib\net46\IL.dll + ..\packages\IllusionLibs.HoneySelect2.IL.2020.5.29.4\lib\net46\IL.dll False - ..\packages\IllusionLibs.HoneySelect2.Sirenix.Serialization.2020.5.29\lib\net46\Sirenix.Serialization.dll + ..\packages\IllusionLibs.HoneySelect2.Sirenix.Serialization.2020.5.29.4\lib\net46\Sirenix.Serialization.dll False - ..\packages\IllusionLibs.HoneySelect2.UniRx.2020.5.29\lib\net46\UniRx.dll + ..\packages\IllusionLibs.HoneySelect2.UniRx.2020.5.29.4\lib\net46\UniRx.dll False @@ -95,39 +91,27 @@ False - ..\packages\IllusionLibs.HoneySelect2.Unity.TextMeshPro.2018.4.11\lib\net46\Unity.TextMeshPro.dll + ..\packages\IllusionLibs.HoneySelect2.Unity.TextMeshPro.2018.4.11.4\lib\net46\Unity.TextMeshPro.dll False - ..\packages\IllusionLibs.HoneySelect2.UnityEngine.CoreModule.2018.4.11\lib\net46\UnityEngine.dll + ..\packages\IllusionLibs.HoneySelect2.UnityEngine.CoreModule.2018.4.11.4\lib\net46\UnityEngine.dll False - ..\packages\IllusionLibs.HoneySelect2.UnityEngine.AssetBundleModule.2018.4.11\lib\net46\UnityEngine.AssetBundleModule.dll + ..\packages\IllusionLibs.HoneySelect2.UnityEngine.AssetBundleModule.2018.4.11.4\lib\net46\UnityEngine.AssetBundleModule.dll False - ..\packages\IllusionLibs.HoneySelect2.UnityEngine.CoreModule.2018.4.11\lib\net46\UnityEngine.CoreModule.dll + ..\packages\IllusionLibs.HoneySelect2.UnityEngine.CoreModule.2018.4.11.4\lib\net46\UnityEngine.CoreModule.dll False - ..\packages\IllusionLibs.HoneySelect2.UnityEngine.ImageConversionModule.2018.4.11\lib\net46\UnityEngine.ImageConversionModule.dll + ..\packages\IllusionLibs.HoneySelect2.UnityEngine.ImageConversionModule.2018.4.11.4\lib\net46\UnityEngine.ImageConversionModule.dll False - ..\packages\IllusionLibs.HoneySelect2.UnityEngine.UI.2018.4.11\lib\net46\UnityEngine.UI.dll - False - - - ..\packages\IllusionLibs.XUnity.AutoTranslator.Plugin.Core.4.11.3\lib\net46\XUnity.AutoTranslator.Plugin.Core.dll - False - - - ..\packages\XUnity.Common.1.0.0\lib\net35\XUnity.Common.dll - False - - - ..\packages\XUnity.ResourceRedirector.1.1.0\lib\net35\XUnity.ResourceRedirector.dll + ..\packages\IllusionLibs.HoneySelect2.UnityEngine.UI.2018.4.11.4\lib\net46\UnityEngine.UI.dll False @@ -153,5 +137,27 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/HS2_QuickAccessBox/packages.config b/HS2_QuickAccessBox/packages.config index 11c3bbc..469eeac 100644 --- a/HS2_QuickAccessBox/packages.config +++ b/HS2_QuickAccessBox/packages.config @@ -1,23 +1,20 @@  - + - - - - - - - - - - - - + + + + + + + + + + + - - - - + + \ No newline at end of file diff --git a/KKS_QuickAccessBox/KKS_QuickAccessBox.csproj b/KKS_QuickAccessBox/KKS_QuickAccessBox.csproj new file mode 100644 index 0000000..ef8f2e8 --- /dev/null +++ b/KKS_QuickAccessBox/KKS_QuickAccessBox.csproj @@ -0,0 +1,185 @@ + + + + + Debug + AnyCPU + {E4810879-FCD1-4DDC-BD48-D13FB9D3EFB1} + Library + Properties + KK_QuickAccessBox + KKS_QuickAccessBox + v4.6 + 512 + true + + + + + true + embedded + false + ..\bin\BepInEx\plugins\ + TRACE;DEBUG;KKS + prompt + 4 + true + + + embedded + true + ..\bin\BepInEx\plugins\ + TRACE;KKS + prompt + 4 + true + true + + + + ..\packages\IllusionLibs.BepInEx.Harmony.2.5.4\lib\net35\0Harmony.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.Assembly-CSharp.2021.9.17\lib\net46\Assembly-CSharp.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.Assembly-CSharp-firstpass.2021.9.17\lib\net46\Assembly-CSharp-firstpass.dll + False + + + ..\packages\IllusionLibs.BepInEx.5.4.15\lib\net35\BepInEx.dll + False + + + ..\packages\IllusionModdingAPI.KKSAPI.1.26.0\lib\net46\KKSAPI.dll + False + + + ..\packages\ExtensibleSaveFormat.KoikatsuSunshine.16.8.0\lib\net46\KKS_ExtensibleSaveFormat.dll + False + + + ..\packages\ScreenshotManager.KoikatsuSunshine.16.8.0\lib\net46\KKS_Screencap.dll + False + + + ..\packages\Sideloader.KoikatsuSunshine.16.8.0\lib\net46\KKS_Sideloader.dll + False + + + ..\packages\IllusionLibs.BepInEx.MonoMod.21.8.5.1\lib\net35\MonoMod.RuntimeDetour.dll + False + + + ..\packages\IllusionLibs.BepInEx.MonoMod.21.8.5.1\lib\net35\MonoMod.Utils.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.CoreModule.2019.4.9\lib\net46\Sirenix.Serialization.dll + False + + + + + + + + + + + ..\packages\IllusionLibs.KoikatsuSunshine.UniRx.2021.9.17\lib\net46\UniRx.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UniTask.2021.9.17\lib\net46\UniTask.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UniTask.2021.9.17\lib\net46\UniTask.Addressables.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UniTask.2021.9.17\lib\net46\UniTask.DOTween.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UniTask.2021.9.17\lib\net46\UniTask.Linq.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UniTask.2021.9.17\lib\net46\UniTask.TextMeshPro.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.CoreModule.2019.4.9\lib\net46\UnityEngine.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.AnimationModule.2019.4.9\lib\net46\UnityEngine.AnimationModule.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.AssetBundleModule.2019.4.9\lib\net46\UnityEngine.AssetBundleModule.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.CoreModule.2019.4.9\lib\net46\UnityEngine.CoreModule.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.InputLegacyModule.2019.4.9\lib\net46\UnityEngine.InputLegacyModule.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.PhysicsModule.2019.4.9\lib\net46\UnityEngine.PhysicsModule.dll + False + + + ..\packages\IllusionLibs.KoikatsuSunshine.UnityEngine.UI.2019.4.9\lib\net46\UnityEngine.UI.dll + False + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/KKS_QuickAccessBox/QuickAccessBox.cs b/KKS_QuickAccessBox/QuickAccessBox.cs new file mode 100644 index 0000000..3d8e761 --- /dev/null +++ b/KKS_QuickAccessBox/QuickAccessBox.cs @@ -0,0 +1,7 @@ +namespace KK_QuickAccessBox +{ + public partial class QuickAccessBox + { + public const string GUID = "KKS_QuickAccessBox"; + } +} \ No newline at end of file diff --git a/KKS_QuickAccessBox/packages.config b/KKS_QuickAccessBox/packages.config new file mode 100644 index 0000000..d8be9f3 --- /dev/null +++ b/KKS_QuickAccessBox/packages.config @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/KK_QuickAccessBox/KK_QuickAccessBox.csproj b/KK_QuickAccessBox/KK_QuickAccessBox.csproj index 29e4ae1..eebabf2 100644 --- a/KK_QuickAccessBox/KK_QuickAccessBox.csproj +++ b/KK_QuickAccessBox/KK_QuickAccessBox.csproj @@ -41,11 +41,11 @@ False - ..\packages\IllusionLibs.Koikatu.Assembly-CSharp.2019.4.27\lib\net35\Assembly-CSharp.dll + ..\packages\IllusionLibs.Koikatu.Assembly-CSharp.2019.4.27.4\lib\net35\Assembly-CSharp.dll False - ..\packages\IllusionLibs.Koikatu.Assembly-CSharp-firstpass.2019.4.27\lib\net35\Assembly-CSharp-firstpass.dll + ..\packages\IllusionLibs.Koikatu.Assembly-CSharp-firstpass.2019.4.27.4\lib\net35\Assembly-CSharp-firstpass.dll False @@ -53,33 +53,29 @@ False - ..\packages\ExtensibleSaveFormat.Koikatu.16.3.0\lib\net35\ExtensibleSaveFormat.dll + ..\packages\ExtensibleSaveFormat.Koikatu.16.3.1\lib\net35\ExtensibleSaveFormat.dll False ..\packages\IllusionModdingAPI.KKAPI.1.20.3\lib\net35\KKAPI.dll False - - ..\..\BepisPlugins\bin\BepInEx\plugins\KK_BepisPlugins\Screencap.dll + + ..\packages\ScreenshotManager.Koikatu.16.3.1\lib\net35\Screencap.dll False - ..\packages\Sideloader.Koikatu.16.0.0\lib\net35\Sideloader.dll + ..\packages\Sideloader.Koikatu.16.3.1\lib\net35\Sideloader.dll False - ..\packages\IllusionLibs.Koikatu.UnityEngine.5.6.2\lib\net35\UnityEngine.dll + ..\packages\IllusionLibs.Koikatu.UnityEngine.5.6.2.4\lib\net35\UnityEngine.dll False - ..\packages\IllusionLibs.Koikatu.UnityEngine.UI.5.6.2\lib\net35\UnityEngine.UI.dll - False - - - ..\packages\IllusionLibs.XUnity.AutoTranslator.Plugin.Core.4.11.3\lib\net35\XUnity.AutoTranslator.Plugin.Core.dll + ..\packages\IllusionLibs.Koikatu.UnityEngine.UI.5.6.2.4\lib\net35\UnityEngine.UI.dll False @@ -108,5 +104,13 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + \ No newline at end of file diff --git a/KK_QuickAccessBox/packages.config b/KK_QuickAccessBox/packages.config index 16c5f5e..6faef9e 100644 --- a/KK_QuickAccessBox/packages.config +++ b/KK_QuickAccessBox/packages.config @@ -1,14 +1,14 @@  - + - - - - - + + + + - + + \ No newline at end of file diff --git a/Shared_QuickAccessBox/ItemInfo.cs b/Shared_QuickAccessBox/ItemInfo.cs index d053398..e67f90c 100644 --- a/Shared_QuickAccessBox/ItemInfo.cs +++ b/Shared_QuickAccessBox/ItemInfo.cs @@ -21,7 +21,7 @@ public ItemInfo(int groupNo, int categoryNo, int itemNo, Info.ItemLoadInfo item if (item == null) throw new ArgumentNullException(nameof(item), "Info.ItemLoadInfo is null in dicItemLoadInfo"); -#if KK +#if KK || KKS DeveloperSearchString = $"{item.childRoot}\v{item.bundlePath}\v{item.fileName}\v{item.manifest}\v{GroupNo}\v{CategoryNo}\v{ItemNo}"; #elif AI || HS2 DeveloperSearchString = $"{item.bundlePath}\v{item.fileName}\v{item.manifest}\v{GroupNo}\v{CategoryNo}\v{ItemNo}"; @@ -43,7 +43,7 @@ public ItemInfo(int groupNo, int categoryNo, int itemNo, Info.ItemLoadInfo item var groupInfo = Info.Instance.dicItemGroupCategory[GroupNo]; if (!groupInfo.dicCategory.ContainsKey(CategoryNo)) throw new ArgumentException("Invalid category number"); -#if KK +#if KK || KKS var origCategoryName = groupInfo.dicCategory[CategoryNo]; #elif AI || HS2 var origCategoryName = groupInfo.dicCategory[CategoryNo].name; @@ -60,27 +60,24 @@ public ItemInfo(int groupNo, int categoryNo, int itemNo, Info.ItemLoadInfo item else { // Get translated versions of the relevant strings - TranslationHelper.Translate( - groupInfo.name, s => - { - GroupName = s; - if (_initFinished) - UpdateCompositeStrings(); - }); - TranslationHelper.Translate( - origCategoryName, s => - { - CategoryName = s; - if (_initFinished) - UpdateCompositeStrings(); - }); - TranslationHelper.Translate( - item.name, s => - { - ItemName = s; - if (_initFinished) - UpdateCompositeStrings(); - }); + Translate(groupInfo.name, s => + { + GroupName = s; + if (_initFinished) + UpdateCompositeStrings(); + }); + Translate(origCategoryName, s => + { + CategoryName = s; + if (_initFinished) + UpdateCompositeStrings(); + }); + Translate(item.name, s => + { + ItemName = s; + if (_initFinished) + UpdateCompositeStrings(); + }); } UpdateCompositeStrings(); @@ -140,7 +137,7 @@ public ItemInfo(int groupNo, int categoryNo, int itemNo, Info.ItemLoadInfo item /// Item is a sound effect and should get the SFX thumbnail /// public bool IsSFX => -#if KK +#if KK || KKS GroupNo == 00000011; // stock 3d sfx #elif AI || HS2 GroupNo == 00000009 || // stock 3d sfx @@ -207,5 +204,24 @@ public override bool Equals(object obj) { return obj is ItemInfo i && i.OriginalItemName == OriginalItemName; } + + private static void Translate(string input, Action updateAction) + { + if (KKAPI.Utilities.TranslationHelper.AutoTranslatorInstalled) + { + var didFire = false; + KKAPI.Utilities.TranslationHelper.TranslateAsync(input, s => + { + updateAction(s); + didFire = true; + ItemInfoLoader.TriggerCacheSave(); + }); + if (didFire) return; + } + + // Make sure there's a valid value set + updateAction(input); + ItemInfoLoader.TriggerCacheSave(); + } } } diff --git a/Shared_QuickAccessBox/Shared_QuickAccessBox.projitems b/Shared_QuickAccessBox/Shared_QuickAccessBox.projitems index 8e538e5..8fa073e 100644 --- a/Shared_QuickAccessBox/Shared_QuickAccessBox.projitems +++ b/Shared_QuickAccessBox/Shared_QuickAccessBox.projitems @@ -19,7 +19,6 @@ - diff --git a/Shared_QuickAccessBox/TranslationHelper.cs b/Shared_QuickAccessBox/TranslationHelper.cs deleted file mode 100644 index 9fa039d..0000000 --- a/Shared_QuickAccessBox/TranslationHelper.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Linq; -using BepInEx; -using XUnity.AutoTranslator.Plugin.Core; - -namespace KK_QuickAccessBox -{ - public static class TranslationHelper - { - private static readonly Action> _translatorCallback; - - static TranslationHelper() - { - var xua = Type.GetType("XUnity.AutoTranslator.Plugin.Core.ITranslator, XUnity.AutoTranslator.Plugin.Core", false); - if (xua != null && xua.GetMethods().Any(x => x.Name == "TranslateAsync")) - { - _translatorCallback = (s, action) => - { - // The lambda doesn't get its types resolved until it's called so this doesn't crash here if the type doesn't exist - AutoTranslator.Default.TranslateAsync(s, result => { if (result.Succeeded) action(result.TranslatedText); }); - }; - } - else - { - QuickAccessBox.Logger.LogWarning("Could not find method AutoTranslator.Default.TranslateAsync, item translations will be limited or unavailable"); - _translatorCallback = null; - } - } - - public static void Translate(string input, Action updateAction) - { - if (updateAction == null) throw new ArgumentNullException(nameof(updateAction)); - - if (_translatorCallback != null) - { - var didFire = false; - _translatorCallback(input, s => - { - updateAction(s); - didFire = true; - ItemInfoLoader.TriggerCacheSave(); - }); - if (didFire) return; - } - - // Make sure there's a valid value set - updateAction(input); - ItemInfoLoader.TriggerCacheSave(); - } - } -} diff --git a/Shared_QuickAccessBox/UI/InterfaceManager.cs b/Shared_QuickAccessBox/UI/InterfaceManager.cs index 4972ec4..2de4503 100644 --- a/Shared_QuickAccessBox/UI/InterfaceManager.cs +++ b/Shared_QuickAccessBox/UI/InterfaceManager.cs @@ -166,7 +166,7 @@ private void CreateSearchMenuButton() btn.onClick.ActuallyRemoveAllListeners(); btn.onClick.AddListener(() => Visible = !Visible); -#if KK +#if KK || KKS _searchMenuButton.GetComponentInChildren().text = "Search..."; #elif AI || HS2 _searchMenuButton.GetComponentInChildren().text = "Search..."; diff --git a/Shared_QuickAccessBox/UI/MovableWindow.cs b/Shared_QuickAccessBox/UI/MovableWindow.cs index 925ddea..251b282 100644 --- a/Shared_QuickAccessBox/UI/MovableWindow.cs +++ b/Shared_QuickAccessBox/UI/MovableWindow.cs @@ -27,7 +27,7 @@ public static MovableWindow MakeObjectDraggable(RectTransform clickableDragZone, public RectTransform toDrag; public bool preventCameraControl; - protected override void Awake() + public override void Awake() { base.Awake(); _cameraControl = FindObjectOfType();