├── .editorconfig ├── .gitattributes ├── .gitignore ├── GeBoPlugins.sln ├── GeBoPlugins.sln.DotSettings ├── PostBuild.bat ├── PostBuild_Config.bat.example.txt ├── README.md ├── _config.yml ├── nuget.config ├── release.ps1 ├── src ├── GameDialogHelper │ ├── KK_GameDialogHelper │ │ ├── AdvancedLogicMemory │ │ │ ├── AnswerMemory.cs │ │ │ ├── CharaDialogMemory.cs │ │ │ └── QuestionMemory.cs │ │ ├── GameDialogHelperCharaController.cs │ │ ├── GameDialogHelperGameController.cs │ │ ├── KK.DialogInfo.cs │ │ ├── KK.Enums.cs │ │ ├── KK.Extensions.cs │ │ ├── KK.GameDialogHelper.Hooks.cs │ │ ├── KK.GameDialogHelper.cs │ │ ├── KK_GameDialogHelper.csproj │ │ ├── PluginDataInfo.cs │ │ ├── PluginModeLogic │ │ │ ├── Advanced.cs │ │ │ ├── Disabled.cs │ │ │ ├── IPluginModeLogic.cs │ │ │ └── RelationshipBased.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── QuestionInfo.cs │ │ ├── Resources │ │ │ ├── QuestionInfos.xml │ │ │ └── QuestionInfos.xsd │ │ └── packages.config │ └── README.md ├── GameDressForSuccess │ ├── KK_GameDressForSuccess │ │ ├── DressForSuccessController.cs │ │ ├── Enums.cs │ │ ├── Extensions.cs │ │ ├── GameDressForSuccess.Hooks.cs │ │ ├── GameDressForSuccess.cs │ │ ├── KK_GameDressForSuccess.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ └── README.md ├── GameWhoIsThere │ ├── HS2_GameWhoIsThere │ │ ├── GameWhoIsThere.cs │ │ ├── HS2_GameWhoIsThere.csproj │ │ ├── Hooks.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ └── README.md ├── GeBoCommon │ ├── AI_GeBoCommon │ │ ├── AI_GeBoCommon.csproj │ │ ├── GeBoAPI.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── Core_GeBoCommon.Shared │ │ ├── Common.cs │ │ ├── Constants.cs │ │ ├── Core_GeBoCommon.Shared.projitems │ │ ├── Core_GeBoCommon.Shared.shproj │ │ └── Utilities │ │ │ ├── ObjectUtils.cs │ │ │ ├── OtherExtensions.cs │ │ │ ├── PluginUtils.cs │ │ │ ├── StringUtils.cs │ │ │ └── TrimmedStringComparer.cs │ ├── Core_GeBoCommon.Studio │ │ ├── Core_GeBoCommon.Studio.shproj │ │ ├── SceneUtils.cs │ │ └── Shared.CharaStudio.projitems │ ├── Core_GeBoCommon │ │ ├── AutoTranslation │ │ │ ├── AutoTranslationHelperBase.cs │ │ │ ├── ComponentTranslationContextBase.cs │ │ │ ├── Delegates.cs │ │ │ ├── IAutoTranslationHelper.cs │ │ │ ├── IComponentTranslationContext.cs │ │ │ ├── ITranslationResult.cs │ │ │ ├── Implementation │ │ │ │ ├── StubAutoTranslationHelper.cs │ │ │ │ └── XUnityAutoTranslationHelper.cs │ │ │ ├── SimpleComponentTranslationContext.cs │ │ │ └── SimpleTranslationResult.cs │ │ ├── Chara │ │ │ ├── Enums.cs │ │ │ └── Extensions.cs │ │ ├── Core_GeBoCommon.shproj │ │ ├── Enums.cs │ │ ├── GeBoAPI.Hooks.cs │ │ ├── GeBoAPIBase.cs │ │ ├── IGeBoAPI.cs │ │ ├── Shared.Core.projitems │ │ ├── Studio │ │ │ ├── Extensions.cs │ │ │ └── StudioUtils.cs │ │ ├── Timers.cs │ │ └── Utilities │ │ │ ├── AsyncWorker.cs │ │ │ ├── CacheDictionary.cs │ │ │ ├── CoroutineHelper.cs │ │ │ ├── CoroutineLimiter.cs │ │ │ ├── Delegates.cs │ │ │ ├── DictionaryPool.cs │ │ │ ├── EnumerableUtils.cs │ │ │ ├── ExpiringSimpleCache.cs │ │ │ ├── HashSetPool.cs │ │ │ ├── HitMissCounter.cs │ │ │ ├── HookedSimpleCache.cs │ │ │ ├── IHookedCache.cs │ │ │ ├── ListPool.cs │ │ │ ├── LockUtils.cs │ │ │ ├── LockWrappers │ │ │ └── LockWrapper.cs │ │ │ ├── NormalizedPathComparer.cs │ │ │ ├── NormalizedPathDictionary.cs │ │ │ ├── ObjectPool.cs │ │ │ ├── PathUtils.cs │ │ │ ├── PoolQueue.cs │ │ │ ├── SimpleCache.Implementation.Concurrent.cs │ │ │ ├── SimpleCache.Implementation.Locks.cs │ │ │ ├── SimpleCache.cs │ │ │ ├── SimpleLazy.cs │ │ │ ├── StringBuilderPool.cs │ │ │ ├── TransferList.cs │ │ │ └── WeakCache.cs │ ├── HS2_GeBoCommon │ │ ├── GeBoAPI.cs │ │ ├── HS2_GeBoCommon.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── KKS_GeBoCommon │ │ ├── Chara │ │ │ └── Extensions.cs │ │ ├── GeBoAPI.cs │ │ ├── KKS_GeBoCommon.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ └── KK_GeBoCommon │ │ ├── Chara │ │ └── Extensions.cs │ │ ├── GeBoAPI.cs │ │ ├── KK_GeBoCommon.csproj │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Timers.cs │ │ └── packages.config ├── StudioCharaAnimFix │ ├── Core_StudioCharaAnimFix │ │ ├── Core_StudioCharaAnimFix.projitems │ │ ├── Core_StudioCharaAnimFix.shproj │ │ ├── StudioCharaAnimFix.Hooks.cs │ │ └── StudioCharaAnimFix.cs │ └── KK_StudioCharaAnimFix │ │ ├── KK_StudioCharaAnimFix.csproj │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ └── packages.config ├── StudioMultiselectChara │ ├── AI_StudioMultiselectChara │ │ ├── AI.StudioMultiselectChara.cs │ │ ├── AI_StudioMultiselectChara.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── Core_StudioMultiselectChara │ │ ├── Core.CharaId.cs │ │ ├── Core.Extensions.cs │ │ ├── Core.StudioMultiselectChara.cs │ │ ├── Core_StudioMultiselectChara.projitems │ │ └── Core_StudioMultiselectChara.shproj │ ├── HS2_StudioMultiselectChara │ │ ├── HS2.StudioMultiselectChara.cs │ │ ├── HS2_StudioMultiselectChara.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── KK_StudioMultiselectChara │ │ ├── KK.StudioMultiselectChara.cs │ │ ├── KK_StudioMultiselectChara.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── README.md │ └── README_Images │ │ ├── ex-01-01.png │ │ ├── ex-01-02.png │ │ └── ex-01-03.png ├── StudioSceneCharaInfo │ ├── AI_StudioSceneCharaInfo │ │ ├── AI.StudioSceneCharaInfo.cs │ │ ├── AI_StudioSceneCharaInfo.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── Core_StudioSceneCharaInfo │ │ ├── Core.StudioSceneCharaInfo.cs │ │ ├── Core_StudioSceneCharaInfo.projitems │ │ └── Core_StudioSceneCharaInfo.shproj │ ├── KK_StudioSceneCharaInfo │ │ ├── KK.StudioSceneCharaInfo.cs │ │ ├── KK_StudioSceneCharaInfo.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ └── README.md ├── StudioSceneInitialCamera │ ├── AI_StudioSceneInitialCamera │ │ ├── AI_StudioSceneInitialCamera.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── Core_StudioSceneInitialCamera │ │ ├── Core_StudioSceneInitialCamera.projitems │ │ ├── Core_StudioSceneInitialCamera.shproj │ │ ├── Extensions.cs │ │ ├── StudioSceneInitialCamera.Hooks.cs │ │ ├── StudioSceneInitialCamera.cs │ │ ├── StudioSceneInitialCameraController.cs │ │ └── Utils.cs │ ├── HS2_StudioSceneInitialCamera │ │ ├── HS2_StudioSceneInitialCamera.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── KK_StudioSceneInitialCamera │ │ ├── KK_StudioSceneInitialCamera.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ └── README.md ├── StudioSceneNavigation │ ├── AI_StudioSceneNavigation │ │ ├── AI.StudioSceneNavigation.cs │ │ ├── AI_StudioSceneNavigation.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── Core_StudioSceneNavigation │ │ ├── Core.StudioSceneNavigation.Hooks.cs │ │ ├── Core.StudioSceneNavigation.Public.cs │ │ ├── Core.StudioSceneNavigation.cs │ │ ├── Core_StudioSceneNavigation.projitems │ │ └── Core_StudioSceneNavigation.shproj │ ├── HS2_StudioSceneNavigation │ │ ├── HS2.StudioSceneNavigation.cs │ │ ├── HS2_StudioSceneNavigation.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── KK_StudioSceneNavigation │ │ ├── KK.StudioSceneNavigation.cs │ │ ├── KK_StudioSceneNavigation.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ └── README.md ├── TranslationCacheCleaner │ ├── AI_TranslationCacheCleaner │ │ ├── AI.TranslationCacheCleaner.cs │ │ ├── AI_TranslationCacheCleaner.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── Core_TranslationCacheCleaner │ │ ├── Core.TranslationCacheCleaner.cs │ │ ├── Core_TranslationCacheCleaner.projitems │ │ └── Core_TranslationCacheCleaner.shproj │ ├── HS2_TranslationCacheCleaner │ │ ├── HS2.TranslationCacheCleaner.cs │ │ ├── HS2_TranslationCacheCleaner.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── KKS_TranslationCacheCleaner │ │ ├── KKS_TranslationCacheCleaner.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ ├── KK_TranslationCacheCleaner │ │ ├── KK.TranslationCacheCleaner.cs │ │ ├── KK_TranslationCacheCleaner.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── packages.config │ └── README.md └── TranslationHelper │ ├── AILike_TranslationHelper │ ├── AILike.TranslationHelper.cs │ ├── AILike_TranslationHelper.projitems │ ├── AILike_TranslationHelper.shproj │ ├── Acceleration │ │ ├── Configuration.cs │ │ └── Hooks.cs │ ├── Chara │ │ ├── Configuration.cs │ │ └── Extensions.cs │ ├── MainGame │ │ ├── Configuration.cs │ │ └── Hooks.cs │ ├── Maker │ │ ├── Configuration.cs │ │ └── Hooks.cs │ ├── Studio │ │ └── Configuration.cs │ ├── Translation │ │ └── Hooks.cs │ └── Utils │ │ └── CharaFileInfoWrapper.cs │ ├── AI_TranslationHelper │ ├── AI.TranslationHelper.cs │ ├── AI_TranslationHelper.csproj │ ├── Acceleration │ │ ├── Configuration.cs │ │ └── Hooks.cs │ ├── MainGame │ │ ├── Configuration.cs │ │ └── Hooks.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Translation │ │ └── Configuration.cs │ ├── Utils │ │ └── GameCharaFileInfoWrapper.cs │ └── packages.config │ ├── Core_TranslationHelper │ ├── Acceleration │ │ ├── Configuration.cs │ │ ├── Hooks.cs │ │ └── StringMethodTranspilerHelper.cs │ ├── CardNameTranslationManager.cs │ ├── Chara │ │ ├── Configuration.cs │ │ ├── Controller.cs │ │ ├── Extensions.cs │ │ ├── Handlers.cs │ │ └── Hooks.cs │ ├── CharaFileInfoTranslationManager.cs │ ├── ComponentTranslationHelpers.cs │ ├── Core_TranslationHelper.projitems │ ├── Core_TranslationHelper.shproj │ ├── Delegates.cs │ ├── Enums.cs │ ├── Extensions.cs │ ├── MainGame │ │ ├── Configuration.cs │ │ ├── Controller.cs │ │ └── Hooks.cs │ ├── Maker │ │ ├── Configuration.cs │ │ └── Hooks.cs │ ├── NameScope.cs │ ├── NameScopeDictionary.cs │ ├── Presets │ │ ├── CardNameCacheBase.cs │ │ ├── CardNameCacheData.cs │ │ ├── CardNameCacheKey.cs │ │ ├── CardNameCacheValue.cs │ │ ├── Data │ │ │ ├── NamePreset.cs │ │ │ ├── NamePresets.cs │ │ │ ├── NameTranslation.cs │ │ │ └── NameTranslations.cs │ │ └── Manager.cs │ ├── Resources │ │ ├── NamePresets.xsd │ │ └── NamePresets │ │ │ ├── AI │ │ │ ├── NPCs.xml │ │ │ ├── StockFemale.xml │ │ │ └── StockMale.xml │ │ │ ├── HS2 │ │ │ ├── NPCs.xml │ │ │ └── StockFemale.xml │ │ │ ├── KK │ │ │ ├── NPCs.xml │ │ │ ├── StockFemale.xml │ │ │ └── StockMale.xml │ │ │ ├── KKS │ │ │ ├── NPCs.xml │ │ │ └── StockFemale.xml │ │ │ ├── Other │ │ │ └── IllusionGamesNPCs.xml │ │ │ └── SBPR │ │ │ └── NPCs.xml │ ├── Studio │ │ ├── Configuration.cs │ │ └── Hooks.cs │ ├── Translation │ │ ├── Configuration.cs │ │ ├── Handlers.cs │ │ ├── Hooks.cs │ │ └── NameTranslator.cs │ ├── TranslationHelper.cs │ ├── TranslationResult.cs │ ├── TranslationTracker.cs │ ├── TranslatorReplacementsManager.cs │ └── Utils │ │ ├── CacheFunctionHelper.cs │ │ ├── CharaFileInfoWrapper.cs │ │ └── ICharaFileInfo.cs │ ├── HS2_TranslationHelper │ ├── HS2.TranslationHelper.cs │ ├── HS2_TranslationHelper.csproj │ ├── MainGame │ │ └── Hooks.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Translation │ │ ├── Configuration.cs │ │ └── Hooks.cs │ └── packages.config │ ├── KKLike_TranslationHelper │ ├── KKLike_TranslationHelper.projitems │ ├── KKLike_TranslationHelper.shproj │ └── MainGame │ │ ├── Configuration.cs │ │ ├── Controller.cs │ │ └── EventArgs.cs │ ├── KKS_TranslationHelper │ ├── Acceleration │ │ ├── Configuration.cs │ │ └── Hooks.cs │ ├── Chara │ │ ├── Configuration.cs │ │ ├── Extensions.cs │ │ └── Hooks.cs │ ├── KKS.TranslationHelper.cs │ ├── KKS_TranslationHelper.csproj │ ├── MainGame │ │ ├── Configuration.cs │ │ ├── Controller.cs │ │ └── Hooks.cs │ ├── Maker │ │ └── Configuration.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Studio │ │ └── Configuration.cs │ ├── Translation │ │ ├── Configuration.cs │ │ ├── Hooks.cs │ │ └── Standard │ │ │ └── Hooks.cs │ ├── Utils │ │ ├── CharaFileInfoWrapper.cs │ │ ├── CustomFileInfoWrapper.cs │ │ ├── DummyFileInfoWrapper.cs │ │ └── ICharaFileInfo.cs │ └── packages.config │ ├── KK_TranslationHelper │ ├── Acceleration │ │ ├── Configuration.cs │ │ └── Hooks.cs │ ├── Chara │ │ ├── Configuration.cs │ │ ├── Extensions.cs │ │ └── Hooks.cs │ ├── KK.TranslationHelper.cs │ ├── KK_TranslationHelper.csproj │ ├── MainGame │ │ ├── Configuration.cs │ │ ├── Controller.cs │ │ └── Hooks.cs │ ├── Maker │ │ └── Configuration.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Studio │ │ ├── Configuration.cs │ │ └── Hooks.cs │ ├── Translation │ │ ├── Configuration.cs │ │ ├── Hooks.cs │ │ ├── Party │ │ │ └── Hooks.cs │ │ └── Standard │ │ │ └── Hooks.cs │ ├── Utils │ │ ├── CharaFileInfoWrapper.cs │ │ ├── CustomFileInfoWrapper.cs │ │ ├── DummyFileInfoWrapper.cs │ │ └── ICharaFileInfo.cs │ └── packages.config │ └── README.md └── update_READMEs.ps1 /PostBuild_Config.bat.example.txt: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | REM 4 | REM Copy to PostBuild_Config.bat and set paths to port to your installation directories. 5 | REM delete or REM out lines to disable specific targets 6 | REM 7 | 8 | set KK_DIR=C:\Illusion\Koikatu 9 | set KK_PARTY_DIR=C:\Steam\steamapps\common\Koikatsu Party 10 | set EC_DIR=C:\Illusion\EmotionCreators 11 | set HS_DIR=C:\Illusion\HoneySelect 12 | set PH_DIR=C:\Illusion\PlayHome 13 | set AI_DIR=C:\Illusion\AI-Syoujyo 14 | set KKS_DIR=C:\Illusion\KoikatsuSunshine -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate 2 | -------------------------------------------------------------------------------- /nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/GameDialogHelper/KK_GameDialogHelper/KK.DialogInfo.cs: -------------------------------------------------------------------------------- 1 | using BepInEx.Logging; 2 | using GeBoCommon.Utilities; 3 | using JetBrains.Annotations; 4 | 5 | namespace GameDialogHelperPlugin 6 | { 7 | [PublicAPI] 8 | public class DialogInfo 9 | { 10 | public DialogInfo(int questionId, int correctAnswerId, int numAnswers) 11 | { 12 | QuestionId = questionId; 13 | CorrectAnswerId = correctAnswerId; 14 | NumAnswers = numAnswers; 15 | SelectedAnswerId = -1; 16 | 17 | QuestionInfo = QuestionInfo.GetById(questionId); 18 | if (!(QuestionInfo is null)) return; 19 | Logger?.LogWarning($"Unable to find QuestionInfo for Id={questionId}"); 20 | QuestionInfo = QuestionInfo.Default; 21 | } 22 | 23 | private static ManualLogSource Logger => GameDialogHelper.Logger; 24 | public int SelectedAnswerId { get; private set; } 25 | public int QuestionId { get; } 26 | public int CorrectAnswerId { get; } 27 | 28 | public int NumAnswers { get; } 29 | 30 | public QuestionInfo QuestionInfo { get; } 31 | 32 | public bool HasBeenAnswered => SelectedAnswerId != -1; 33 | public bool WasAnsweredCorrectly => SelectedAnswerId == CorrectAnswerId; 34 | 35 | public void RecordAnswer(int answerId) 36 | { 37 | Logger.DebugLogDebug($"{nameof(RecordAnswer)}: {answerId}"); 38 | SelectedAnswerId = answerId; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/GameDialogHelper/KK_GameDialogHelper/PluginDataInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace GameDialogHelperPlugin 4 | { 5 | internal static class PluginDataInfo 6 | { 7 | /* 8 | * DataVersion history 9 | * 10 | * 1 - initial nested dictionary version 11 | * 2 - CharaDialogMemory 12 | * 3 - reworked AnswerMemory adding Recall 13 | * 4 - reworked keys names 14 | */ 15 | public const int DataVersion = 4; 16 | public const int MinimumSupportedGameDataVersion = 4; 17 | public const int MinimumSupportedCardDataVersion = 4; 18 | 19 | public const int CurrentSaveGuidVersion = 1; 20 | public const int MaxSaveGuidVersion = CurrentSaveGuidVersion; 21 | 22 | public const int CurrentCharaGuidVersion = 6; 23 | public const int MaxCharaGuidVersion = CurrentCharaGuidVersion; 24 | public const int MinimumSupportedCharaGuidVersion = 5; 25 | 26 | [SuppressMessage("ReSharper", "UnusedMember.Global")] 27 | internal static class Keys 28 | { 29 | public const string SaveGuid = nameof(SaveGuid); 30 | public const string SaveGuidVersion = nameof(SaveGuidVersion); 31 | public const string DialogMemory = nameof(DialogMemory); 32 | public const string CharaGuid = nameof(CharaGuid); 33 | public const string CharaGuidVersion = nameof(CharaGuidVersion); 34 | public const string PlayerGuid = nameof(PlayerGuid); 35 | public const string PlayerGuidVersion = nameof(PlayerGuidVersion); 36 | public const string LastUpdated = nameof(LastUpdated); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/GameDialogHelper/KK_GameDialogHelper/PluginModeLogic/Disabled.cs: -------------------------------------------------------------------------------- 1 | using TMPro; 2 | 3 | namespace GameDialogHelperPlugin.PluginModeLogic 4 | { 5 | public class Disabled : IPluginModeLogic 6 | { 7 | public string CorrectHighlight => string.Empty; 8 | 9 | public string IncorrectHighlight => string.Empty; 10 | 11 | public bool EnabledForHeroine(SaveData.Heroine heroine) 12 | { 13 | return false; 14 | } 15 | 16 | public bool EnabledForQuestion(SaveData.Heroine heroine, DialogInfo dialogInfo) 17 | { 18 | return false; 19 | } 20 | 21 | public bool EnableForAnswer(SaveData.Heroine heroine, DialogInfo dialogInfo, int answer) 22 | { 23 | return false; 24 | } 25 | 26 | public void ProcessDialogAnswered(SaveData.Heroine heroine, DialogInfo dialogInfo, bool isCorrect) { } 27 | 28 | public void ApplyHighlightSelection(int answerId, TextMeshProUGUI text) { } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/GameDialogHelper/KK_GameDialogHelper/PluginModeLogic/IPluginModeLogic.cs: -------------------------------------------------------------------------------- 1 | using TMPro; 2 | 3 | namespace GameDialogHelperPlugin.PluginModeLogic 4 | { 5 | public interface IPluginModeLogic 6 | { 7 | string CorrectHighlight { get; } 8 | 9 | string IncorrectHighlight { get; } 10 | 11 | bool EnabledForHeroine(SaveData.Heroine heroine); 12 | 13 | bool EnabledForQuestion(SaveData.Heroine heroine, DialogInfo dialogInfo); 14 | 15 | bool EnableForAnswer(SaveData.Heroine heroine, DialogInfo dialogInfo, int correctAnswer); 16 | 17 | void ProcessDialogAnswered(SaveData.Heroine heroine, DialogInfo dialogInfo, bool isCorrect); 18 | 19 | void ApplyHighlightSelection(int answerId, TextMeshProUGUI text); 20 | 21 | //void OnCorrectAnswerSelected(); 22 | 23 | //void OnIncorrectAnswerSelected(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/GameDialogHelper/KK_GameDialogHelper/PluginModeLogic/RelationshipBased.cs: -------------------------------------------------------------------------------- 1 | using TMPro; 2 | 3 | namespace GameDialogHelperPlugin.PluginModeLogic 4 | { 5 | public class RelationshipBased : IPluginModeLogic 6 | 7 | { 8 | public string CorrectHighlight => GameDialogHelper.CorrectHighlight.Value; 9 | 10 | public string IncorrectHighlight => string.Empty; 11 | 12 | public bool EnabledForHeroine(SaveData.Heroine heroine) 13 | { 14 | return heroine != null && heroine.relation >= (int)GameDialogHelper.MinimumRelationshipLevel.Value; 15 | } 16 | 17 | public bool EnabledForQuestion(SaveData.Heroine heroine, DialogInfo dialogInfo) 18 | { 19 | return EnabledForHeroine(heroine); 20 | } 21 | 22 | public bool EnableForAnswer(SaveData.Heroine heroine, DialogInfo dialogInfo, int answer) 23 | { 24 | return EnabledForQuestion(heroine, dialogInfo) && answer == dialogInfo.CorrectAnswerId; 25 | } 26 | 27 | public void ProcessDialogAnswered(SaveData.Heroine heroine, DialogInfo dialogInfo, bool isCorrect) { } 28 | 29 | public void ApplyHighlightSelection(int answerId, TextMeshProUGUI text) 30 | { 31 | GameDialogHelper.DefaultApplyHighlightSelection(answerId, text); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/GameDialogHelper/KK_GameDialogHelper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static GameDialogHelperPlugin.GameDialogHelper; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("d9c58c8c-1d67-455f-8251-8c9d8a4734be")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for Koikatsu")] 26 | [assembly: AssemblyTitle("KK_" + nameof(GameDialogHelperPlugin.GameDialogHelper))] 27 | [assembly: AssemblyProduct("KK_" + nameof(GameDialogHelperPlugin.GameDialogHelper))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/GameDialogHelper/KK_GameDialogHelper/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/GameDressForSuccess/KK_GameDressForSuccess/DressForSuccessController.cs: -------------------------------------------------------------------------------- 1 | using ActionGame; 2 | using BepInEx.Logging; 3 | using GeBoCommon.Utilities; 4 | using KKAPI.MainGame; 5 | 6 | namespace GameDressForSuccessPlugin 7 | { 8 | internal class DressForSuccessController : GameCustomFunctionController 9 | { 10 | protected static ManualLogSource Logger => 11 | GameDressForSuccess.Instance != null ? GameDressForSuccess.Instance.Logger : null; 12 | 13 | private static void HandleResetToAutomatic(ResetToAutomaticMode minimumMode) 14 | { 15 | if (GameDressForSuccess.ResetToAutomatic.Value < minimumMode) return; 16 | GameDressForSuccess.Instance.SafeProcObject(o => o.SetPlayerClothesToAutomatic()); 17 | } 18 | 19 | protected override void OnPeriodChange(Cycle.Type period) 20 | { 21 | Logger?.DebugLogDebug($"{this.GetPrettyTypeFullName()}.{nameof(OnPeriodChange)}({period})"); 22 | HandleResetToAutomatic(ResetToAutomaticMode.PeriodChange); 23 | base.OnPeriodChange(period); 24 | } 25 | 26 | protected override void OnGameSave(GameSaveLoadEventArgs args) 27 | { 28 | Logger?.DebugLogDebug($"{this.GetPrettyTypeFullName()}.{nameof(OnGameSave)}()"); 29 | HandleResetToAutomatic(ResetToAutomaticMode.DayChange); 30 | base.OnGameSave(args); 31 | } 32 | 33 | protected override void OnDayChange(Cycle.Week day) 34 | { 35 | Logger?.DebugLogDebug($"{this.GetPrettyTypeFullName()}.{nameof(OnDayChange)}({day})"); 36 | HandleResetToAutomatic(ResetToAutomaticMode.DayChange); 37 | base.OnDayChange(day); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/GameDressForSuccess/KK_GameDressForSuccess/Enums.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using JetBrains.Annotations; 3 | 4 | namespace GameDressForSuccessPlugin 5 | { 6 | public enum PluginMode 7 | { 8 | [Description("Always change")] 9 | Always, 10 | 11 | [Description("Only if clothing type is auto")] 12 | AutomaticOnly 13 | } 14 | 15 | 16 | public enum ResetToAutomaticMode 17 | { 18 | [UsedImplicitly] 19 | [Description("Default game behavior")] 20 | Never = 0, 21 | 22 | [Description("At the start of each day")] 23 | DayChange = 1, 24 | 25 | [Description("At the start of each period")] 26 | PeriodChange = 2 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/GameDressForSuccess/KK_GameDressForSuccess/Extensions.cs: -------------------------------------------------------------------------------- 1 | using ADV; 2 | using KKAPI.MainGame; 3 | 4 | namespace GameDressForSuccessPlugin 5 | { 6 | internal static class Extensions 7 | { 8 | public static bool IsNullOrNpc(this SaveData.Heroine heroine) 9 | { 10 | return heroine == null || heroine.FixCharaIDOrPersonality < 0; 11 | } 12 | 13 | public static bool IsNullOrNpc(this CharaData charaData) 14 | { 15 | if (charaData == null || charaData.chaCtrl == null) return true; 16 | return charaData.chaCtrl.GetHeroine().IsNullOrNpc(); 17 | } 18 | 19 | public static int GetCoordinateType(this SaveData.Heroine heroine) 20 | { 21 | var result = -1; 22 | heroine.SafeProc(h => h.chaCtrl.SafeProc( 23 | cc => cc.chaFile.SafeProc( 24 | cf => cf.status.SafeProc( 25 | s => result = s.coordinateType)))); 26 | return result; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/GameDressForSuccess/KK_GameDressForSuccess/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static GameDressForSuccessPlugin.GameDressForSuccess; 4 | 5 | 6 | 7 | // Setting ComVisible to false makes the types in this assembly not visible 8 | // to COM components. If you need to access a type in this assembly from 9 | // COM, set the ComVisible attribute to true on that type. 10 | [assembly: ComVisible(false)] 11 | 12 | // The following GUID is for the ID of the typelib if this project is exposed to COM 13 | [assembly: Guid("7193dfae-7481-4708-bcbb-81d01ff9f413")] 14 | 15 | // Version information for an assembly consists of the following four values: 16 | // 17 | // Major Version 18 | // Minor Version 19 | // Build Number 20 | // Revision 21 | // 22 | // You can specify all the values or you can default the Build and Revision Numbers 23 | // by using the '*' as shown below: 24 | // [assembly: AssemblyVersion("1.0.*")] 25 | [assembly: AssemblyVersion(Version)] 26 | [assembly: AssemblyFileVersion(Version)] 27 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 28 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(GameDressForSuccessPlugin.GameDressForSuccess))] 29 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(GameDressForSuccessPlugin.GameDressForSuccess))] 30 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 31 | -------------------------------------------------------------------------------- /src/GameDressForSuccess/KK_GameDressForSuccess/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/GameDressForSuccess/README.md: -------------------------------------------------------------------------------- 1 | # GameDressForSuccess 2 | 3 | When the player is invited (or invites a girl) to swim/exercise he can automatically change clothes rather than going in what he's already wearing. By default only applies if player clothes are already set to automatic, but can be configured to always be applied. 4 | 5 | ## Supported Games 6 | 7 | | | Game | Studio | Download | 8 | | ----------------------: | :---: | :-----: | ------------ | 9 | | Koikatu/Koikatsu Party | ✔️ | ❌ | [KK_GameDressForSuccess] | 10 | 11 | ## Configuration 12 | 13 | ### Settings 14 | 15 | #### Enabled 16 | 17 | If not set to true entire plugin is disabled. 18 | 19 | #### Mode 20 | 21 | - **AutomaticOnly** - Default option. Only change players clothes if the players clothing type is already set to automatic in the game 22 | - **Always** - Ignore the game setting and always change clothes when it makes sense. 23 | 24 | ### Reset to Automatic 25 | 26 | - **Never** - Default game behavior 27 | - **DayChange** - Reset to automatic each day 28 | - **PeriodChange** - Default option. Reset player clothes to automatic at each period change. 29 | 30 | ## Technical Info 31 | 32 | ### Dependencies 33 | 34 | - [Illusion Modding API](https://github.com/IllusionMods/IllusionModdingAPI) v1.20.3+ 35 | - [BepInEx](https://github.com/BepInEx/BepInEx) v5.4.8+ 36 | 37 | [//]: # (## Latest Links) 38 | 39 | [KK_GameDressForSuccess]: https://github.com/GeBo1/GeBoPlugins/releases/download/r34/KK_GameDressForSuccess.v1.2.0.2.zip "v1.2.0.2" -------------------------------------------------------------------------------- /src/GameWhoIsThere/HS2_GameWhoIsThere/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static GameWhoIsTherePlugin.GameWhoIsThere; 4 | 5 | 6 | // Setting ComVisible to false makes the types in this assembly not visible 7 | // to COM components. If you need to access a type in this assembly from 8 | // COM, set the ComVisible attribute to true on that type. 9 | [assembly: ComVisible(false)] 10 | 11 | // The following GUID is for the ID of the typelib if this project is exposed to COM 12 | [assembly: Guid("37a04b58-c00f-4b59-9f42-d0fb8dd9e7c1")] 13 | 14 | // Version information for an assembly consists of the following four values: 15 | // 16 | // Major Version 17 | // Minor Version 18 | // Build Number 19 | // Revision 20 | // 21 | // You can specify all the values or you can default the Build and Revision Numbers 22 | // by using the '*' as shown below: 23 | // [assembly: AssemblyVersion("1.0.*")] 24 | [assembly: AssemblyVersion(Version)] 25 | [assembly: AssemblyFileVersion(Version)] 26 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 27 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(GeBoCommon))] 28 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(GeBoCommon))] 29 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 30 | -------------------------------------------------------------------------------- /src/GameWhoIsThere/HS2_GameWhoIsThere/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/GameWhoIsThere/README.md: -------------------------------------------------------------------------------- 1 | # GameWhoIsThere 2 | 3 | Let's you see who will in "surprise" events before they start. 4 | 5 | ## Supported Games 6 | 7 | | | Game | Studio | Download | 8 | | ----------------------: | :---: | :-----: | ------------ | 9 | | Honey Select 2 | ✔️ | ❌ | [HS2 Latest] | 10 | 11 | ## Configuration 12 | 13 | ### Settings 14 | 15 | #### Enabled 16 | 17 | If not set to true entire plugin is disabled. 18 | 19 | #### Keyboard Shortcuts 20 | 21 | ##### Toggle showing who is in room 22 | 23 | Display name of character in surprise events 24 | 25 | ## Technical Info 26 | 27 | ### Dependencies 28 | 29 | - [BepInEx](https://github.com/BepInEx/BepInEx) v5.4.8+ 30 | 31 | [//]: # (## Latest Links) 32 | 33 | [HS2 Latest]: https://github.com/GeBo1/GeBoPlugins/releases/download/r30/HS2_GameWhoIsThere.v1.0.1.3.zip "v1.0.1.3" -------------------------------------------------------------------------------- /src/GeBoCommon/AI_GeBoCommon/GeBoAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using AIChara; 4 | using AIProject; 5 | using GeBoCommon.Chara; 6 | using Manager; 7 | using IllusionStudio = Studio; 8 | 9 | namespace GeBoCommon 10 | { 11 | public partial class GeBoAPI 12 | { 13 | private static readonly IList> ChaFileNamesInternal = 14 | new List> 15 | { 16 | new KeyValuePair("fullname", NameType.Unclassified) 17 | }.AsReadOnly(); 18 | 19 | 20 | public IEnumerable> ChaFileEnumerateNames(ChaFile chaFile) 21 | { 22 | yield return new KeyValuePair(0, chaFile?.parameter?.fullname); 23 | } 24 | 25 | public string ChaFileFullName(ChaFile chaFile) 26 | { 27 | return chaFile?.parameter.fullname; 28 | } 29 | 30 | public void ChaFileSetName(ChaFile chaFile, int index, string chaName) 31 | { 32 | if (index == 0) 33 | { 34 | chaFile.parameter.fullname = chaName; 35 | } 36 | else 37 | { 38 | throw new InvalidOperationException($"{index} is not a valid name index for this game"); 39 | } 40 | } 41 | 42 | public void PlayNotification(NotificationSound notificationSound) 43 | { 44 | SoundPack.SystemSE sound; 45 | switch (notificationSound) 46 | { 47 | case NotificationSound.Success: 48 | sound = SoundPack.SystemSE.OK_L; 49 | break; 50 | 51 | case NotificationSound.Error: 52 | sound = SoundPack.SystemSE.Error; 53 | break; 54 | 55 | default: 56 | sound = SoundPack.SystemSE.Cancel; 57 | break; 58 | } 59 | 60 | Singleton.Instance.SoundPack.Play(sound); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/GeBoCommon/AI_GeBoCommon/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static GeBoCommon.GeBoAPI; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("622df8ad-567c-4036-8e13-636a5bbebb43")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + PluginName)] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + PluginName)] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon.Shared/Common.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Text; 3 | using BepInEx.Logging; 4 | using JetBrains.Annotations; 5 | #if GEBO_COMMON_FULL 6 | using GeBoCommon.Utilities; 7 | #endif 8 | 9 | 10 | namespace GeBoCommon 11 | { 12 | internal static class Common 13 | { 14 | private static ManualLogSource _currentLogger; 15 | 16 | internal static ManualLogSource CurrentLogger => 17 | _currentLogger ?? (_currentLogger = new ManualLogSource(nameof(GeBoCommon))); 18 | 19 | [UsedImplicitly] 20 | internal static void SetCurrentLogger(ManualLogSource logger) 21 | { 22 | _currentLogger = logger; 23 | } 24 | 25 | internal static StringBuilder RequestStringBuilder() 26 | { 27 | #if GEBO_COMMON_FULL 28 | return StringBuilderPool.Get(); 29 | #else 30 | return new StringBuilder(); 31 | #endif 32 | } 33 | 34 | [Conditional("GEBO_COMMON_FULL")] 35 | // ReSharper disable once UnusedParameter.Global 36 | internal static void ReleaseStringBuilder(StringBuilder stringBuilder) 37 | { 38 | #if GEBO_COMMON_FULL 39 | StringBuilderPool.Release(stringBuilder); 40 | #endif 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon.Shared/Core_GeBoCommon.Shared.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 7c2442d2-1c58-4c20-bcb0-3a56c8dddb16 7 | 8 | 9 | GeBoCommon 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon.Shared/Core_GeBoCommon.Shared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7c2442d2-1c58-4c20-bcb0-3a56c8dddb16 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon.Shared/Utilities/ObjectUtils.cs: -------------------------------------------------------------------------------- 1 | #if !KK 2 | #define HAS_ARRAY_EMPTY 3 | #endif 4 | using JetBrains.Annotations; 5 | #if HAS_ARRAY_EMPTY 6 | using System; 7 | #endif 8 | 9 | namespace GeBoCommon.Utilities 10 | { 11 | [PublicAPI] 12 | public static class ObjectUtils 13 | { 14 | [PublicAPI] 15 | public static int GetCombinedHashCode(params object[] objects) 16 | { 17 | var result = 17; 18 | foreach (var obj in objects) 19 | { 20 | unchecked 21 | { 22 | result = (result * 31) + obj.GetHashCode(); 23 | } 24 | } 25 | 26 | return result; 27 | } 28 | 29 | [PublicAPI] 30 | public static T[] GetEmptyArray() 31 | { 32 | #if HAS_ARRAY_EMPTY 33 | return Array.Empty(); 34 | #else 35 | return new T[0]; 36 | #endif 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon.Shared/Utilities/PluginUtils.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using JetBrains.Annotations; 3 | using UnityEngine; 4 | 5 | namespace GeBoCommon.Utilities 6 | { 7 | public static class PluginUtils 8 | { 9 | [PublicAPI] 10 | public static T InstanceGetter(ref T cachedInstance) where T : BaseUnityPlugin 11 | { 12 | if (cachedInstance == null) 13 | { 14 | cachedInstance = Object.FindObjectOfType(); 15 | } 16 | 17 | return cachedInstance; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon.Studio/Core_GeBoCommon.Studio.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | fd627628-359c-4edc-959d-598999a4bfcf 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon.Studio/SceneUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics.CodeAnalysis; 4 | using System.IO; 5 | using GeBoCommon.Utilities; 6 | using HarmonyLib; 7 | using JetBrains.Annotations; 8 | using Studio; 9 | 10 | namespace GeBoCommon.Studio 11 | { 12 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 13 | public static partial class SceneUtils 14 | { 15 | private static readonly SimpleLazy>> SceneLoadSceneListPathGetter = 16 | new SimpleLazy>>(() => 17 | Delegates.LazyReflectionInstanceGetter>("listPath")); 18 | 19 | [PublicAPI] 20 | public static readonly string StudioSceneRootFolder = 21 | PathUtils.NormalizePath(Path.Combine(UserData.Path, @"studio\scene")).ToLowerInvariant(); 22 | 23 | [PublicAPI] 24 | public static List GetSceneLoaderPaths(SceneLoadScene loader) 25 | { 26 | List result = null; 27 | loader.SafeProc(l => result = SceneLoadSceneListPathGetter.Value(l)); 28 | return result ?? new List(); 29 | } 30 | 31 | [UsedImplicitly] 32 | public static OCIChar GetMainChara(object instance) 33 | { 34 | return Traverse.Create(instance)?.Property("ociChar")?.GetValue(); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon.Studio/Shared.CharaStudio.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | fd627628-359c-4edc-959d-598999a4bfcf 7 | 8 | 9 | GeBoCommon.Studio 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/AutoTranslation/AutoTranslationHelperBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using BepInEx.Logging; 3 | using UnityEngine; 4 | using UnityEngine.SceneManagement; 5 | 6 | namespace GeBoCommon.AutoTranslation 7 | { 8 | internal class AutoTranslationHelperBase 9 | { 10 | protected static ManualLogSource Logger => Common.CurrentLogger; 11 | 12 | protected static bool FallbackTryTranslate(string key, out string translatedText) 13 | { 14 | translatedText = string.Empty; 15 | _ = key; 16 | return false; 17 | } 18 | 19 | protected static void FallbackAddTranslationToCache(string key, string value, bool persistToDisk, 20 | int translationType, 21 | int scope) 22 | { 23 | _ = persistToDisk || translationType == scope || string.IsNullOrEmpty(key ?? value); 24 | } 25 | 26 | protected static void FallbackTranslateAsync(string key, Action onCompleted, 27 | ITranslationResult cannedResult) 28 | { 29 | _ = key; 30 | onCompleted(cannedResult); 31 | } 32 | 33 | protected static int FallbackGetCurrentTranslationScope() 34 | { 35 | try 36 | { 37 | try 38 | { 39 | return SceneManager.GetActiveScene().buildIndex; 40 | } 41 | catch 42 | { 43 | #pragma warning disable CS0618 // Type or member is obsolete 44 | return Application.loadedLevel; 45 | #pragma warning restore CS0618 // Type or member is obsolete 46 | } 47 | } 48 | catch 49 | { 50 | return -1; 51 | } 52 | } 53 | 54 | protected static string NoOpTransformStringDelegate(string text) 55 | { 56 | return text; 57 | } 58 | 59 | protected static bool AlwaysFalseTestStringDelegate(string text) 60 | { 61 | _ = text; 62 | return false; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/AutoTranslation/ComponentTranslationContextBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace GeBoCommon.AutoTranslation 6 | { 7 | internal class ComponentTranslationContextBase 8 | { 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/AutoTranslation/Delegates.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JetBrains.Annotations; 3 | 4 | namespace GeBoCommon.AutoTranslation 5 | { 6 | [PublicAPI] 7 | public delegate bool TryTranslateDelegate(string untranslatedText, out string translatedText); 8 | 9 | [PublicAPI] 10 | public delegate void TranslateAsyncDelegate(string untranslatedText, Action onCompleted); 11 | 12 | [PublicAPI] 13 | public delegate void AddTranslationToCacheDelegate(string key, string value, bool persistToDisk, 14 | int translationType, int scope); 15 | 16 | [PublicAPI] 17 | public delegate void ReloadTranslationsDelegate(); 18 | 19 | [PublicAPI] 20 | public delegate bool IsTranslatableDelegate(string text); 21 | 22 | [PublicAPI] 23 | public delegate bool TestStringDelegate(string text); 24 | 25 | [PublicAPI] 26 | public delegate string TransformStringDelegate(string text); 27 | } 28 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/AutoTranslation/IAutoTranslationHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using BepInEx.Logging; 4 | using JetBrains.Annotations; 5 | 6 | namespace GeBoCommon.AutoTranslation 7 | { 8 | [PublicAPI] 9 | public interface IAutoTranslationHelper 10 | { 11 | ManualLogSource Logger { get; } 12 | object DefaultCache { get; } 13 | 14 | bool TryTranslate(string untranslatedText, out string translatedText); 15 | bool TryTranslate(string untranslatedText, int scope, out string translatedText); 16 | 17 | void TranslateAsync(string untranslatedText, Action onCompleted); 18 | 19 | void TranslateAsync(string untranslatedText, int scope, Action onCompleted); 20 | 21 | void IgnoreTextComponent(object textComponent); 22 | 23 | void UnignoreTextComponent(object textComponent); 24 | 25 | void RegisterOnTranslatingCallback(Action context); 26 | 27 | void UnregisterOnTranslatingCallback(Action context); 28 | 29 | void AddTranslationToCache(string key, string value, bool persistToDisk, int translationType, int scope); 30 | void ReloadTranslations(); 31 | bool IsTranslatable(string text); 32 | 33 | Dictionary GetReplacements(); 34 | 35 | string GetAutoTranslationsFilePath(); 36 | 37 | Dictionary GetTranslations(); 38 | HashSet GetRegisteredRegexes(); 39 | HashSet GetRegisteredSplitterRegexes(); 40 | 41 | int GetCurrentTranslationScope(); 42 | 43 | bool ContainsVariableSymbol(string text); 44 | bool IsRedirected(string text); 45 | string FixRedirected(string text); 46 | string MakeRedirected(string text); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/AutoTranslation/IComponentTranslationContext.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace GeBoCommon.AutoTranslation 4 | { 5 | [PublicAPI] 6 | public interface IComponentTranslationContext 7 | { 8 | object Component { get; } 9 | string OriginalText { get; } 10 | string OverriddenTranslatedText { get; } 11 | void ResetBehaviour(); 12 | void OverrideTranslatedText(string translation); 13 | void IgnoreComponent(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/AutoTranslation/ITranslationResult.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace GeBoCommon.AutoTranslation 4 | { 5 | public interface ITranslationResult 6 | { 7 | bool Succeeded { get; } 8 | string TranslatedText { get; } 9 | 10 | [UsedImplicitly] 11 | string ErrorMessage { get; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/AutoTranslation/SimpleComponentTranslationContext.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace GeBoCommon.AutoTranslation 4 | { 5 | [PublicAPI] 6 | public class SimpleComponentTranslationContext : IComponentTranslationContext 7 | { 8 | public object Component => null; 9 | 10 | public string OriginalText => null; 11 | 12 | public string OverriddenTranslatedText => null; 13 | 14 | public void IgnoreComponent() { } 15 | 16 | public void OverrideTranslatedText(string translation) { } 17 | 18 | public void ResetBehaviour() { } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/AutoTranslation/SimpleTranslationResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using GeBoCommon.Utilities; 3 | 4 | namespace GeBoCommon.AutoTranslation 5 | { 6 | public class SimpleTranslationResult : ITranslationResult 7 | { 8 | public SimpleTranslationResult(bool succeeded, string translatedText = null, string errorMessage = null) 9 | { 10 | if (succeeded && translatedText == null) 11 | { 12 | throw new ArgumentException("can not be null if succeeded is true", nameof(translatedText)); 13 | } 14 | 15 | 16 | Succeeded = succeeded; 17 | TranslatedText = translatedText; 18 | ErrorMessage = errorMessage; 19 | } 20 | 21 | public bool Succeeded { get; } 22 | public string TranslatedText { get; } 23 | public string ErrorMessage { get; } 24 | 25 | public override string ToString() 26 | { 27 | return $"{this.GetPrettyTypeName()}({Succeeded}, {TranslatedText}, {ErrorMessage})"; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/Core_GeBoCommon.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | c57337f1-3e5e-4880-9cc0-461a2d088a81 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/Enums.cs: -------------------------------------------------------------------------------- 1 | namespace GeBoCommon 2 | { 3 | public enum NotificationSound 4 | { 5 | Success, 6 | Error 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/GeBoAPI.Hooks.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace GeBoCommon 4 | { 5 | partial class GeBoAPI 6 | { 7 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 8 | private static partial class Hooks { } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/Utilities/EnumerableUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using JetBrains.Annotations; 5 | 6 | namespace GeBoCommon.Utilities 7 | { 8 | [PublicAPI] 9 | public static class EnumerableUtils 10 | { 11 | /// 12 | /// Checks if one enumerable can be found within another 13 | /// 14 | /// Searching inside this. 15 | /// Searching for this. 16 | /// IComparer to use 17 | /// true if found, otherwise false 18 | public static bool EnumerableContains(IEnumerable haystack, IEnumerable needle, 19 | IComparer comparer = null) where T : IComparable 20 | { 21 | if (haystack is null) return false; 22 | var haystackList = haystack.ToList(); 23 | var haystackLength = haystackList.Count; 24 | var needleList = needle.ToList(); 25 | var needleLength = needleList.Count; 26 | 27 | comparer = comparer ?? Comparer.Default; 28 | 29 | var start = 0; 30 | // while first item exists in remaining haystack 31 | while ((start = haystackList.IndexOf(needleList[0], start)) != -1) 32 | { 33 | // only keep checking if haystack would fit 34 | if (start + needleLength > haystackLength) break; 35 | 36 | var found = true; 37 | for (var i = 1; i < needleLength; i++) 38 | { 39 | if (comparer.Compare(needleList[i], haystackList[start + i]) == 0) continue; 40 | 41 | // mismatch 42 | found = false; 43 | break; 44 | } 45 | 46 | if (found) return true; 47 | } 48 | 49 | return false; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/Utilities/HashSetPool.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GeBoCommon.Utilities 4 | { 5 | public static class HashSetPool 6 | { 7 | private static readonly ObjectPool> Pool = new ObjectPool>(null, x => x.Clear()); 8 | 9 | public static HashSet Get() 10 | { 11 | return !GeBoAPI.EnableObjectPools ? new HashSet() : Pool.Get(); 12 | } 13 | 14 | public static void Release(HashSet obj) 15 | { 16 | if (GeBoAPI.EnableObjectPools) Pool.Release(obj); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/Utilities/IHookedCache.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace GeBoCommon.Utilities 4 | { 5 | [PublicAPI] 6 | public interface IHookedCacheEventArgs 7 | { 8 | bool Cancel { get; } 9 | object Target { get; } 10 | } 11 | 12 | public interface IHookedCache 13 | { 14 | void OnHookPrefix(IHookedCacheEventArgs e); 15 | void OnHookPostfix(IHookedCacheEventArgs e); 16 | object ConvertTargetToKey(object obj); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/Utilities/ListPool.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GeBoCommon.Utilities 4 | { 5 | public static class ListPool 6 | { 7 | private static readonly ObjectPool> Pool = new ObjectPool>(null, x => x.Clear()); 8 | 9 | public static List Get() 10 | { 11 | return !GeBoAPI.EnableObjectPools ? new List() : Pool.Get(); 12 | } 13 | 14 | public static void Release(List obj) 15 | { 16 | if (GeBoAPI.EnableObjectPools) Pool.Release(obj); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/Utilities/LockUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using GeBoCommon.Utilities.LockWrappers; 3 | 4 | namespace GeBoCommon.Utilities 5 | { 6 | public static class LockUtils 7 | { 8 | public static ReaderWriterLockSlim CreateLock( 9 | LockRecursionPolicy recursionPolicy = LockRecursionPolicy.SupportsRecursion) 10 | { 11 | return new ReaderWriterLockSlim(recursionPolicy); 12 | } 13 | 14 | public static LockWrapper GetDisposableReadOnlyLock(this ReaderWriterLockSlim lockSlim) 15 | { 16 | return new ReadOnlyLockWrapper(lockSlim); 17 | } 18 | 19 | public static LockWrapper GetDisposableUpgradableReadLock(this ReaderWriterLockSlim lockSlim) 20 | { 21 | return new UpgradableReadLockWrapper(lockSlim); 22 | } 23 | 24 | public static LockWrapper GetDisposableWriteLock(this ReaderWriterLockSlim lockSlim) 25 | { 26 | return new WriteLockWrapper(lockSlim); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/Utilities/NormalizedPathComparer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GeBoCommon.Utilities 4 | { 5 | public class NormalizedPathComparer : StringComparer 6 | { 7 | private static readonly ExpiringSimpleCache HashCodeCache = 8 | new ExpiringSimpleCache(CalculateHashCode, TimeSpan.FromMinutes(10), 9 | $"{typeof(NormalizedPathComparer).PrettyTypeFullName()}.{nameof(HashCodeCache)}"); 10 | 11 | internal NormalizedPathComparer() { } 12 | 13 | private static string NormalizePathString(string input) 14 | { 15 | try 16 | { 17 | return PathUtils.NormalizePath(input); 18 | } 19 | catch 20 | { 21 | return input; 22 | } 23 | } 24 | 25 | public override bool Equals(string x, string y) 26 | { 27 | if (x == y) return true; 28 | if (x == null || y == null) return false; 29 | if (OrdinalIgnoreCase.Equals(x, y)) return true; 30 | 31 | return GetHashCode(x) == GetHashCode(y); 32 | } 33 | 34 | private static int CalculateHashCode(string obj) 35 | { 36 | return OrdinalIgnoreCase.GetHashCode(NormalizePathString(obj)); 37 | } 38 | 39 | public override int GetHashCode(string obj) 40 | { 41 | return HashCodeCache[obj]; 42 | } 43 | 44 | public override int Compare(string x, string y) 45 | { 46 | return OrdinalIgnoreCase.Compare(NormalizePathString(x), NormalizePathString(y)); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/GeBoCommon/Core_GeBoCommon/Utilities/StringBuilderPool.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace GeBoCommon.Utilities 4 | { 5 | public static class StringBuilderPool 6 | { 7 | private static readonly ObjectPool 8 | Pool = new ObjectPool(null, ClearStringBuilder); 9 | 10 | private static void ClearStringBuilder(StringBuilder stringBuilder) 11 | { 12 | if (stringBuilder.Length < 512) 13 | { 14 | stringBuilder.Length = 0; 15 | } 16 | else 17 | { 18 | stringBuilder.Replace(stringBuilder.ToString(), string.Empty); 19 | } 20 | } 21 | 22 | public static StringBuilder Get() 23 | { 24 | return !GeBoAPI.EnableObjectPools ? new StringBuilder() : Pool.Get(); 25 | } 26 | 27 | public static void Release(StringBuilder obj) 28 | { 29 | if (GeBoAPI.EnableObjectPools) Pool.Release(obj); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/GeBoCommon/HS2_GeBoCommon/GeBoAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using AIChara; 4 | using GeBoCommon.Chara; 5 | using Illusion.Game; 6 | using IllusionStudio = Studio; 7 | 8 | namespace GeBoCommon 9 | { 10 | public partial class GeBoAPI 11 | { 12 | private static readonly IList> ChaFileNamesInternal = 13 | new List> 14 | { 15 | new KeyValuePair("fullname", NameType.Unclassified) 16 | }.AsReadOnly(); 17 | 18 | 19 | public IEnumerable> ChaFileEnumerateNames(ChaFile chaFile) 20 | { 21 | yield return new KeyValuePair(0, chaFile?.parameter?.fullname); 22 | } 23 | 24 | public string ChaFileFullName(ChaFile chaFile) 25 | { 26 | return chaFile?.parameter.fullname; 27 | } 28 | 29 | public void ChaFileSetName(ChaFile chaFile, int index, string chaName) 30 | { 31 | if (index == 0) 32 | { 33 | chaFile.parameter.fullname = chaName; 34 | } 35 | else 36 | { 37 | throw new InvalidOperationException($"{index} is not a valid name index for this game"); 38 | } 39 | } 40 | 41 | public void PlayNotification(NotificationSound notificationSound) 42 | { 43 | SystemSE sound; 44 | switch (notificationSound) 45 | { 46 | case NotificationSound.Success: 47 | sound = SystemSE.ok_l; 48 | break; 49 | 50 | case NotificationSound.Error: 51 | sound = SystemSE.cancel; 52 | break; 53 | 54 | default: 55 | sound = SystemSE.ok_s; 56 | break; 57 | } 58 | 59 | Utils.Sound.Play(sound); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/GeBoCommon/HS2_GeBoCommon/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static GeBoCommon.GeBoAPI; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("eaf3bd49-5bcd-4b95-b929-b229da9c0596")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(GeBoCommon))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(GeBoCommon))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/GeBoCommon/KKS_GeBoCommon/Chara/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JetBrains.Annotations; 3 | using KKAPI.MainGame; 4 | 5 | namespace GeBoCommon.Chara 6 | { 7 | public static partial class Extensions 8 | { 9 | /// 10 | /// Get the persisting CharaData object that describes this character 11 | /// (Heroine or Player depending on sex) 12 | /// Returns null if the could not be found. Works only in the main game. 13 | /// 14 | [PublicAPI] 15 | public static SaveData.CharaData GetCharaData(this ChaControl chaControl) 16 | { 17 | if (chaControl == null) throw new ArgumentNullException(nameof(chaControl)); 18 | return chaControl.chaFile.GetCharaData(); 19 | } 20 | 21 | /// 22 | /// Get the persisting CharaData object that describes this character 23 | /// (Heroine or Player depending on sex) 24 | /// Returns null if the could not be found. Works only in the main game. 25 | /// 26 | [PublicAPI] 27 | public static SaveData.CharaData GetCharaData(this ChaFileControl chaFile) 28 | { 29 | if (chaFile == null) throw new ArgumentNullException(nameof(chaFile)); 30 | switch (chaFile.GetSex()) 31 | { 32 | case CharacterSex.Female: 33 | return chaFile.GetHeroine(); 34 | 35 | case CharacterSex.Male: 36 | return chaFile.GetPlayer(); 37 | 38 | default: 39 | return null; 40 | } 41 | } 42 | 43 | [PublicAPI] 44 | public static CharacterSex GetSex(this SaveData.CharaData charaData) 45 | { 46 | return (CharacterSex)Manager.Game.CharaDataToSex(charaData); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/GeBoCommon/KKS_GeBoCommon/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static GeBoCommon.GeBoAPI; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("e9869c56-ed07-42c5-a203-136473033995")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(GeBoCommon))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(GeBoCommon))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/GeBoCommon/KK_GeBoCommon/Chara/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JetBrains.Annotations; 3 | using KKAPI.MainGame; 4 | 5 | namespace GeBoCommon.Chara 6 | { 7 | public static partial class Extensions 8 | { 9 | /// 10 | /// Get the persisting CharaData object that describes this character 11 | /// (Heroine or Player depending on sex) 12 | /// Returns null if the could not be found. Works only in the main game. 13 | /// 14 | public static SaveData.CharaData GetCharaData(this ChaControl chaControl) 15 | { 16 | if (chaControl == null) throw new ArgumentNullException(nameof(chaControl)); 17 | return chaControl.chaFile.GetCharaData(); 18 | } 19 | 20 | /// 21 | /// Get the persisting CharaData object that describes this character 22 | /// (Heroine or Player depending on sex) 23 | /// Returns null if the could not be found. Works only in the main game. 24 | /// 25 | public static SaveData.CharaData GetCharaData(this ChaFileControl chaFile) 26 | { 27 | if (chaFile == null) throw new ArgumentNullException(nameof(chaFile)); 28 | switch (chaFile.GetSex()) 29 | { 30 | case CharacterSex.Female: 31 | return chaFile.GetHeroine(); 32 | 33 | case CharacterSex.Male: 34 | return chaFile.GetPlayer(); 35 | 36 | default: 37 | return null; 38 | } 39 | } 40 | 41 | [PublicAPI] 42 | public static CharacterSex GetSex(this SaveData.CharaData charaData) 43 | { 44 | return (CharacterSex)Manager.Game.CharaDataToSex(charaData); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/GeBoCommon/KK_GeBoCommon/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static GeBoCommon.GeBoAPI; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("ed839651-4764-420e-97fc-a40d7d98449b")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(GeBoCommon))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(GeBoCommon))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/GeBoCommon/KK_GeBoCommon/Timers.cs: -------------------------------------------------------------------------------- 1 | #if TIMERS 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using ChaCustom; 7 | using GeBoCommon.Utilities; 8 | using HarmonyLib; 9 | using UnityEngine; 10 | 11 | namespace GeBoCommon 12 | { 13 | internal static partial class Timers 14 | { 15 | internal static partial class Hooks 16 | { 17 | private static float _charaListLoadingStartTime; 18 | 19 | [HarmonyPrefix, HarmonyPatch(typeof(CustomCharaFile), "Initialize")] 20 | public static void CustomScenePrefix() 21 | { 22 | try 23 | { 24 | if (!GeBoAPI.TimersEnabled) return; 25 | _charaListLoadingStartTime = Time.realtimeSinceStartup; 26 | } 27 | catch (Exception err) 28 | { 29 | Logger.LogException(err, $"{typeof(Hooks).GetPrettyTypeFullName()}.{nameof(CustomScenePrefix)}"); 30 | } 31 | 32 | } 33 | 34 | [HarmonyPostfix, HarmonyPatch(typeof(CustomCharaFile), "Initialize")] 35 | public static void CustomScenePostfix() 36 | { 37 | try 38 | { 39 | if (!GeBoAPI.TimersEnabled) return; 40 | LogTimerAtEndOfFrame("MakerCharaListLoadingTimer", _charaListLoadingStartTime); 41 | } 42 | catch (Exception err) 43 | { 44 | Logger.LogException(err, $"{typeof(Hooks).GetPrettyTypeFullName()}.{nameof(CustomScenePostfix)}"); 45 | } 46 | } 47 | } 48 | } 49 | } 50 | #endif 51 | -------------------------------------------------------------------------------- /src/GeBoCommon/KK_GeBoCommon/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/StudioCharaAnimFix/Core_StudioCharaAnimFix/Core_StudioCharaAnimFix.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 835a7d88-63a4-4fe0-b868-b71901198973 7 | 8 | 9 | StudioCharaAnimFixPlugin 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/StudioCharaAnimFix/Core_StudioCharaAnimFix/Core_StudioCharaAnimFix.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 835a7d88-63a4-4fe0-b868-b71901198973 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/StudioCharaAnimFix/KK_StudioCharaAnimFix/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using GeBoCommon; 4 | using StudioCharaAnimFixPlugin; 5 | 6 | 7 | // Setting ComVisible to false makes the types in this assembly not visible 8 | // to COM components. If you need to access a type in this assembly from 9 | // COM, set the ComVisible attribute to true on that type. 10 | [assembly: ComVisible(false)] 11 | 12 | // The following GUID is for the ID of the typelib if this project is exposed to COM 13 | [assembly: Guid("4a600a62-3caf-47f8-b1ec-be161313a5f5")] 14 | 15 | 16 | // Version information for an assembly consists of the following four values: 17 | // 18 | // Major Version 19 | // Minor Version 20 | // Build Number 21 | // Revision 22 | // 23 | // You can specify all the values or you can default the Build and Revision Numbers 24 | // by using the '*' as shown below: 25 | // [assembly: AssemblyVersion("1.0.*")] 26 | [assembly: AssemblyVersion(StudioCharaAnimFix.Version)] 27 | [assembly: AssemblyFileVersion(StudioCharaAnimFix.Version)] 28 | [assembly: AssemblyDescription(StudioCharaAnimFix.PluginName + " for " + Constants.GameName)] 29 | [assembly: AssemblyTitle(Constants.Prefix + "_" + nameof(StudioCharaAnimFix))] 30 | [assembly: AssemblyProduct(Constants.Prefix + "_" + nameof(StudioCharaAnimFix))] 31 | [assembly: AssemblyCompany(Constants.RepoUrl)] 32 | -------------------------------------------------------------------------------- /src/StudioCharaAnimFix/KK_StudioCharaAnimFix/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 13 | 15 | 17 | 18 | 19 | 21 | 23 | 24 | -------------------------------------------------------------------------------- /src/StudioMultiselectChara/AI_StudioMultiselectChara/AI.StudioMultiselectChara.cs: -------------------------------------------------------------------------------- 1 | namespace StudioMultiSelectCharaPlugin 2 | { 3 | public partial class StudioMultiSelectChara { } 4 | } 5 | -------------------------------------------------------------------------------- /src/StudioMultiselectChara/AI_StudioMultiselectChara/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static StudioMultiSelectCharaPlugin.StudioMultiSelectChara; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | 9 | // Setting ComVisible to false makes the types in this assembly not visible 10 | // to COM components. If you need to access a type in this assembly from 11 | // COM, set the ComVisible attribute to true on that type. 12 | [assembly: ComVisible(false)] 13 | 14 | // The following GUID is for the ID of the typelib if this project is exposed to COM 15 | [assembly: Guid("6b983c93-3232-41dc-b844-eb96bf7897ba")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion(Version)] 28 | [assembly: AssemblyFileVersion(Version)] 29 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 30 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(StudioMultiSelectCharaPlugin.StudioMultiSelectChara))] 31 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(StudioMultiSelectCharaPlugin.StudioMultiSelectChara))] 32 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 33 | -------------------------------------------------------------------------------- /src/StudioMultiselectChara/Core_StudioMultiselectChara/Core_StudioMultiselectChara.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | a9bb5821-ceb9-42dc-b31f-820188043eac 7 | 8 | 9 | StudioMultiSelectCharaPlugin 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/StudioMultiselectChara/Core_StudioMultiselectChara/Core_StudioMultiselectChara.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | a9bb5821-ceb9-42dc-b31f-820188043eac 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/StudioMultiselectChara/HS2_StudioMultiselectChara/HS2.StudioMultiselectChara.cs: -------------------------------------------------------------------------------- 1 | namespace StudioMultiSelectCharaPlugin 2 | { 3 | public partial class StudioMultiSelectChara { } 4 | } 5 | -------------------------------------------------------------------------------- /src/StudioMultiselectChara/HS2_StudioMultiselectChara/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static StudioMultiSelectCharaPlugin.StudioMultiSelectChara; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("347e78e9-4046-46c8-9569-d51d3a79fb69")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(StudioMultiSelectCharaPlugin.StudioMultiSelectChara))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(StudioMultiSelectCharaPlugin.StudioMultiSelectChara))] 28 | 29 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 30 | -------------------------------------------------------------------------------- /src/StudioMultiselectChara/KK_StudioMultiselectChara/KK.StudioMultiselectChara.cs: -------------------------------------------------------------------------------- 1 | namespace StudioMultiSelectCharaPlugin 2 | { 3 | public partial class StudioMultiSelectChara { } 4 | } 5 | -------------------------------------------------------------------------------- /src/StudioMultiselectChara/KK_StudioMultiselectChara/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static StudioMultiSelectCharaPlugin.StudioMultiSelectChara; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("e94c2711-d9e6-4b23-85af-af84cb4567db")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(StudioMultiSelectCharaPlugin.StudioMultiSelectChara))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(StudioMultiSelectCharaPlugin.StudioMultiSelectChara))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/StudioMultiselectChara/KK_StudioMultiselectChara/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/StudioMultiselectChara/README.md: -------------------------------------------------------------------------------- 1 | # StudioMultiselectChara 2 | 3 | If you select a character in studio and press the hotkey, all other instances of that character in the scene will also be selected. Useful for replacing all instances of a given character. 4 | 5 | ## Supported Games 6 | 7 | | | Game | Studio | Download | 8 | | ----------------------: | :---: | :-----: | ------------ | 9 | | Koikatu/Koikatsu Party | ❌ | ✔️ | [KK_StudioMultiselectChara] | 10 | | AI-Shoujo/AI-Syoujyo | ❌ | ✔️ | [AI_StudioMultiselectChara] | 11 | | Honey Select 2 | ❌ | ✔️ | [HS2_StudioMultiselectChara] | 12 | 13 | 14 | ## Technical Info 15 | 16 | ### Dependencies 17 | 18 | - [GeBoCommon](https://github.com/GeBo1/GeBoPlugins) 19 | - [Illusion Modding API](https://github.com/IllusionMods/IllusionModdingAPI) v1.20.3+ 20 | - [BepInEx](https://github.com/BepInEx/BepInEx) v5.4.8+ 21 | 22 | 23 | ## Example 24 | 25 | Select a character in the tree: 26 | ![Select character in tree](README_Images/ex-01-01.png) 27 | 28 | Hit the hotkey (defaults to `Shift-Tab`) and all instances of the same character in the scene will be selected: 29 | ![Select character in tree](README_Images/ex-01-02.png) 30 | 31 | Now you can quickly apply changes to all selected characters (like Replace Character): 32 | ![Select character in tree](README_Images/ex-01-03.png) 33 | 34 | [//]: # (## Latest Links) 35 | 36 | [AI_StudioMultiselectChara]: https://github.com/GeBo1/GeBoPlugins/releases/download/r33/AI_StudioMultiselectChara.v1.0.0.2.zip "v1.0.0.2" 37 | [HS2_StudioMultiselectChara]: https://github.com/GeBo1/GeBoPlugins/releases/download/r33/HS2_StudioMultiselectChara.v1.0.0.2.zip "v1.0.0.2" 38 | [KK_StudioMultiselectChara]: https://github.com/GeBo1/GeBoPlugins/releases/download/r33/KK_StudioMultiselectChara.v1.0.0.2.zip "v1.0.0.2" 39 | 40 | -------------------------------------------------------------------------------- /src/StudioMultiselectChara/README_Images/ex-01-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeBo1/GeBoPlugins/b256245e34856257a7cc2dfbab3e9e1e1b2cc343/src/StudioMultiselectChara/README_Images/ex-01-01.png -------------------------------------------------------------------------------- /src/StudioMultiselectChara/README_Images/ex-01-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeBo1/GeBoPlugins/b256245e34856257a7cc2dfbab3e9e1e1b2cc343/src/StudioMultiselectChara/README_Images/ex-01-02.png -------------------------------------------------------------------------------- /src/StudioMultiselectChara/README_Images/ex-01-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GeBo1/GeBoPlugins/b256245e34856257a7cc2dfbab3e9e1e1b2cc343/src/StudioMultiselectChara/README_Images/ex-01-03.png -------------------------------------------------------------------------------- /src/StudioSceneCharaInfo/AI_StudioSceneCharaInfo/AI.StudioSceneCharaInfo.cs: -------------------------------------------------------------------------------- 1 | namespace StudioSceneCharaInfoPlugin 2 | { 3 | public partial class StudioSceneCharaInfo 4 | { 5 | internal const string HspeGuid = "com.joan6694.kkplugins.aipe"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/StudioSceneCharaInfo/AI_StudioSceneCharaInfo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static StudioSceneCharaInfoPlugin.StudioSceneCharaInfo; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("4ad155c4-ca3e-4e34-8d6d-822cd860f27f")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(StudioSceneCharaInfoPlugin.StudioSceneCharaInfo))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(StudioSceneCharaInfoPlugin.StudioSceneCharaInfo))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/StudioSceneCharaInfo/AI_StudioSceneCharaInfo/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/StudioSceneCharaInfo/Core_StudioSceneCharaInfo/Core_StudioSceneCharaInfo.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 73ece425-f128-41c7-8d24-6567ab8b4923 7 | 8 | 9 | StudioSceneCharaInfoPlugin 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/StudioSceneCharaInfo/Core_StudioSceneCharaInfo/Core_StudioSceneCharaInfo.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 73ece425-f128-41c7-8d24-6567ab8b4923 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/StudioSceneCharaInfo/KK_StudioSceneCharaInfo/KK.StudioSceneCharaInfo.cs: -------------------------------------------------------------------------------- 1 | namespace StudioSceneCharaInfoPlugin 2 | { 3 | public partial class StudioSceneCharaInfo 4 | { 5 | internal const string HspeGuid = "com.joan6694.kkplugins.kkpe"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/StudioSceneCharaInfo/KK_StudioSceneCharaInfo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static StudioSceneCharaInfoPlugin.StudioSceneCharaInfo; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("1bdc5051-b62d-44f9-b48f-12f78174d6cb")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(StudioSceneCharaInfoPlugin.StudioSceneCharaInfo))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(StudioSceneCharaInfoPlugin.StudioSceneCharaInfo))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/StudioSceneCharaInfo/KK_StudioSceneCharaInfo/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/StudioSceneCharaInfo/README.md: -------------------------------------------------------------------------------- 1 | # StudioSceneCharaInfo 2 | 3 | ## Technical Info 4 | 5 | ### Supported Games 6 | 7 | | | Game | Studio | 8 | | ----------------------:| ------------------ | ------------------ | 9 | | Koikatu/Koikatsu Party | :x: | :heavy_check_mark: | 10 | | AI-Shoujo/AI-Syoujyo | :x: | :heavy_check_mark: | 11 | | Honey Select 2 | :x: | :heavy_check_mark: | 12 | 13 | 14 | ### Dependencies 15 | 16 | - [GeBoCommon](https://github.com/GeBo1/GeBoPlugins) 17 | - [Illusion Modding API](https://github.com/IllusionMods/IllusionModdingAPI) v1.12.3+ 18 | - [BepInEx](https://github.com/BepInEx/BepInEx) v5.1+ 19 | 20 | -------------------------------------------------------------------------------- /src/StudioSceneInitialCamera/AI_StudioSceneInitialCamera/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using GeBoCommon; 4 | using StudioSceneInitialCameraPlugin; 5 | using static StudioSceneInitialCameraPlugin.StudioSceneInitialCamera; 6 | 7 | // Setting ComVisible to false makes the types in this assembly not visible 8 | // to COM components. If you need to access a type in this assembly from 9 | // COM, set the ComVisible attribute to true on that type. 10 | [assembly: ComVisible(false)] 11 | 12 | // The following GUID is for the ID of the typelib if this project is exposed to COM 13 | [assembly: Guid("71077222-18a2-46b5-b09d-69ba2f2c02e3")] 14 | 15 | 16 | // Version information for an assembly consists of the following four values: 17 | // 18 | // Major Version 19 | // Minor Version 20 | // Build Number 21 | // Revision 22 | // 23 | // You can specify all the values or you can default the Build and Revision Numbers 24 | // by using the '*' as shown below: 25 | // [assembly: AssemblyVersion("1.0.*")] 26 | [assembly: AssemblyVersion(Version)] 27 | [assembly: AssemblyFileVersion(Version)] 28 | [assembly: AssemblyDescription(PluginName + " for " + Constants.GameName)] 29 | [assembly: AssemblyTitle(Constants.Prefix + "_" + nameof(StudioSceneInitialCamera))] 30 | [assembly: AssemblyProduct(Constants.Prefix + "_" + nameof(StudioSceneInitialCamera))] 31 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 32 | 33 | -------------------------------------------------------------------------------- /src/StudioSceneInitialCamera/Core_StudioSceneInitialCamera/Core_StudioSceneInitialCamera.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 827bdf45-718f-49aa-bc22-29641ab2ba68 7 | 8 | 9 | StudioSceneInitialCameraPlugin 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/StudioSceneInitialCamera/Core_StudioSceneInitialCamera/Core_StudioSceneInitialCamera.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 827bdf45-718f-49aa-bc22-29641ab2ba68 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/StudioSceneInitialCamera/Core_StudioSceneInitialCamera/Extensions.cs: -------------------------------------------------------------------------------- 1 | namespace StudioSceneInitialCameraPlugin 2 | { 3 | public static class Extensions 4 | { 5 | public static void SelectInitialCamera(this Studio.CameraControl cameraControl, bool storeInSave = false) 6 | { 7 | if (cameraControl == null) return; 8 | 9 | var controller = StudioSceneInitialCamera.GetController(); 10 | 11 | if (controller != null && !controller.InitialCameraSavePending) 12 | { 13 | var backupData = controller.CurrentInitialCameraDataBackup; 14 | if (backupData != null) 15 | { 16 | cameraControl.Import(backupData); 17 | if (storeInSave) Utils.GetSceneInfo().SafeProc(si => si.cameraSaveData = backupData); 18 | return; 19 | } 20 | } 21 | 22 | var sceneInfo = Utils.GetSceneInfo(); 23 | if (sceneInfo != null && sceneInfo.cameraSaveData != null) 24 | { 25 | cameraControl.Import(sceneInfo.cameraSaveData); 26 | } 27 | } 28 | 29 | public static bool IsSame(this Studio.CameraControl.CameraData cameraData1, 30 | Studio.CameraControl.CameraData cameraData2) 31 | { 32 | return cameraData1 != null && cameraData2 != null && cameraData1.distance == cameraData2.distance && 33 | cameraData1.pos == cameraData2.pos && 34 | cameraData1.rotate == cameraData2.rotate && cameraData1.rotation == cameraData2.rotation; 35 | } 36 | 37 | public static bool IsFree(this Studio.CameraControl.CameraData cameraData) 38 | { 39 | return cameraData.IsSame(Utils.GetResetCamera()); 40 | } 41 | 42 | public static bool IsInitial(this Studio.CameraControl.CameraData cameraData) 43 | { 44 | return cameraData.IsSame(Utils.GetSceneSaveCamera()); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/StudioSceneInitialCamera/Core_StudioSceneInitialCamera/Utils.cs: -------------------------------------------------------------------------------- 1 | using Studio; 2 | 3 | namespace StudioSceneInitialCameraPlugin 4 | { 5 | internal static class Utils 6 | { 7 | internal static Studio.CameraControl GetCameraControl() 8 | { 9 | Studio.CameraControl cameraControl = null; 10 | Studio.Studio.Instance.SafeProc(instance => cameraControl = instance.cameraCtrl); 11 | return cameraControl; 12 | } 13 | 14 | internal static SceneInfo GetSceneInfo() 15 | { 16 | SceneInfo sceneInfo = null; 17 | Studio.Studio.Instance.SafeProc(instance => sceneInfo = instance.sceneInfo); 18 | return sceneInfo; 19 | } 20 | 21 | internal static Studio.CameraControl.CameraData GetResetCamera() 22 | { 23 | Studio.CameraControl.CameraData resetData = null; 24 | GetCameraControl().SafeProc(cc => resetData = cc.cameraReset); 25 | return resetData; 26 | } 27 | 28 | internal static Studio.CameraControl.CameraData GetSceneSaveCamera() 29 | { 30 | Studio.CameraControl.CameraData sceneSaveCamera = null; 31 | GetSceneInfo().SafeProc(si => sceneSaveCamera = si.cameraSaveData); 32 | return sceneSaveCamera; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/StudioSceneInitialCamera/HS2_StudioSceneInitialCamera/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using GeBoCommon; 4 | using StudioSceneInitialCameraPlugin; 5 | using static StudioSceneInitialCameraPlugin.StudioSceneInitialCamera; 6 | 7 | // Setting ComVisible to false makes the types in this assembly not visible 8 | // to COM components. If you need to access a type in this assembly from 9 | // COM, set the ComVisible attribute to true on that type. 10 | [assembly: ComVisible(false)] 11 | 12 | // The following GUID is for the ID of the typelib if this project is exposed to COM 13 | [assembly: Guid("760d13d7-2729-4e5c-9746-549c32bf5c1f")] 14 | 15 | 16 | // Version information for an assembly consists of the following four values: 17 | // 18 | // Major Version 19 | // Minor Version 20 | // Build Number 21 | // Revision 22 | // 23 | // You can specify all the values or you can default the Build and Revision Numbers 24 | // by using the '*' as shown below: 25 | // [assembly: AssemblyVersion("1.0.*")] 26 | [assembly: AssemblyVersion(Version)] 27 | [assembly: AssemblyFileVersion(Version)] 28 | [assembly: AssemblyDescription(PluginName + " for " + Constants.GameName)] 29 | [assembly: AssemblyTitle(Constants.Prefix + "_" + nameof(StudioSceneInitialCamera))] 30 | [assembly: AssemblyProduct(Constants.Prefix + "_" + nameof(StudioSceneInitialCamera))] 31 | [assembly: AssemblyCompany(Constants.RepoUrl)] 32 | -------------------------------------------------------------------------------- /src/StudioSceneInitialCamera/KK_StudioSceneInitialCamera/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using GeBoCommon; 4 | using StudioSceneInitialCameraPlugin; 5 | using static StudioSceneInitialCameraPlugin.StudioSceneInitialCamera; 6 | 7 | // Setting ComVisible to false makes the types in this assembly not visible 8 | // to COM components. If you need to access a type in this assembly from 9 | // COM, set the ComVisible attribute to true on that type. 10 | [assembly: ComVisible(false)] 11 | 12 | // The following GUID is for the ID of the typelib if this project is exposed to COM 13 | [assembly: Guid("94abcf42-4cbb-45ee-9ed4-59cbd2138574")] 14 | 15 | 16 | // Version information for an assembly consists of the following four values: 17 | // 18 | // Major Version 19 | // Minor Version 20 | // Build Number 21 | // Revision 22 | // 23 | // You can specify all the values or you can default the Build and Revision Numbers 24 | // by using the '*' as shown below: 25 | // [assembly: AssemblyVersion("1.0.*")] 26 | [assembly: AssemblyVersion(Version)] 27 | [assembly: AssemblyFileVersion(Version)] 28 | [assembly: AssemblyDescription(PluginName + " for " + Constants.GameName)] 29 | [assembly: AssemblyTitle(Constants.Prefix + "_" + nameof(StudioSceneInitialCamera))] 30 | [assembly: AssemblyProduct(Constants.Prefix + "_" + nameof(StudioSceneInitialCamera))] 31 | [assembly: AssemblyCompany(Constants.RepoUrl)] 32 | -------------------------------------------------------------------------------- /src/StudioSceneInitialCamera/KK_StudioSceneInitialCamera/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/StudioSceneNavigation/AI_StudioSceneNavigation/AI.StudioSceneNavigation.cs: -------------------------------------------------------------------------------- 1 | namespace StudioSceneNavigationPlugin 2 | { 3 | public partial class StudioSceneNavigation 4 | { 5 | private const int ImagesPerPage = 12; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/StudioSceneNavigation/AI_StudioSceneNavigation/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | using System.Runtime.InteropServices; 4 | using static StudioSceneNavigationPlugin.StudioSceneNavigation; 5 | 6 | // Setting ComVisible to false makes the types in this assembly not visible 7 | // to COM components. If you need to access a type in this assembly from 8 | // COM, set the ComVisible attribute to true on that type. 9 | [assembly: ComVisible(false)] 10 | 11 | // The following GUID is for the ID of the typelib if this project is exposed to COM 12 | [assembly: Guid("c2c7182a-8f3e-495f-b350-6cef46627a2b")] 13 | 14 | // Version information for an assembly consists of the following four values: 15 | // 16 | // Major Version 17 | // Minor Version 18 | // Build Number 19 | // Revision 20 | // 21 | // You can specify all the values or you can default the Build and Revision Numbers 22 | // by using the '*' as shown below: 23 | // [assembly: AssemblyVersion("1.0.*")] 24 | [assembly: AssemblyVersion(Version)] 25 | [assembly: AssemblyFileVersion(Version)] 26 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 27 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(StudioSceneNavigationPlugin.StudioSceneNavigation))] 28 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(StudioSceneNavigationPlugin.StudioSceneNavigation))] 29 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 30 | -------------------------------------------------------------------------------- /src/StudioSceneNavigation/AI_StudioSceneNavigation/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/StudioSceneNavigation/Core_StudioSceneNavigation/Core.StudioSceneNavigation.Hooks.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using GeBoCommon.Utilities; 3 | using HarmonyLib; 4 | using Studio; 5 | 6 | namespace StudioSceneNavigationPlugin 7 | { 8 | partial class StudioSceneNavigation 9 | { 10 | internal static class Hooks 11 | { 12 | [HarmonyPostfix] 13 | [HarmonyPatch(typeof(SceneLoadScene), nameof(SceneLoadScene.InitInfo))] 14 | internal static void SceneLoadScene_InitInfo_Postfix(SceneLoadScene __instance) 15 | { 16 | Logger.DebugLogDebug($"{nameof(SceneLoadScene_InitInfo_Postfix)}: start"); 17 | try 18 | { 19 | Instance.SafeProc(i => i.OnInitInfo(__instance)); 20 | } 21 | catch (Exception err) 22 | { 23 | Logger.LogException(err, __instance, nameof(SceneLoadScene_InitInfo_Postfix)); 24 | } 25 | finally 26 | { 27 | Logger.DebugLogDebug($"{nameof(SceneLoadScene_InitInfo_Postfix)}: end"); 28 | } 29 | } 30 | 31 | [HarmonyPostfix] 32 | [HarmonyPatch(typeof(SceneLoadScene), nameof(SceneLoadScene.SetPage))] 33 | internal static void SceneLoadScene_SetPage_Postfix(SceneLoadScene __instance, int _page) 34 | { 35 | Logger.DebugLogDebug($"{nameof(SceneLoadScene_SetPage_Postfix)}: start: {_page}"); 36 | try 37 | { 38 | Instance.SafeProc(i => i.OnSetPage(__instance, _page)); 39 | } 40 | catch (Exception err) 41 | { 42 | Logger.LogException(err, __instance, nameof(SceneLoadScene_InitInfo_Postfix)); 43 | } 44 | finally 45 | { 46 | Logger.DebugLogDebug($"{nameof(SceneLoadScene_SetPage_Postfix)}: end: {_page}"); 47 | } 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/StudioSceneNavigation/Core_StudioSceneNavigation/Core_StudioSceneNavigation.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 9bf51fb9-d251-492b-a0b2-35e479ed90eb 7 | 8 | 9 | StudioSceneNavigationPlugin 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/StudioSceneNavigation/Core_StudioSceneNavigation/Core_StudioSceneNavigation.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9bf51fb9-d251-492b-a0b2-35e479ed90eb 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/StudioSceneNavigation/HS2_StudioSceneNavigation/HS2.StudioSceneNavigation.cs: -------------------------------------------------------------------------------- 1 | namespace StudioSceneNavigationPlugin 2 | { 3 | public partial class StudioSceneNavigation 4 | { 5 | private const int ImagesPerPage = 12; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/StudioSceneNavigation/HS2_StudioSceneNavigation/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static StudioSceneNavigationPlugin.StudioSceneNavigation; 4 | 5 | 6 | // Setting ComVisible to false makes the types in this assembly not visible 7 | // to COM components. If you need to access a type in this assembly from 8 | // COM, set the ComVisible attribute to true on that type. 9 | [assembly: ComVisible(false)] 10 | 11 | // The following GUID is for the ID of the typelib if this project is exposed to COM 12 | [assembly: Guid("19796e45-b2ff-4206-8901-a1821b797df8")] 13 | 14 | // Version information for an assembly consists of the following four values: 15 | // 16 | // Major Version 17 | // Minor Version 18 | // Build Number 19 | // Revision 20 | // 21 | // You can specify all the values or you can default the Build and Revision Numbers 22 | // by using the '*' as shown below: 23 | // [assembly: AssemblyVersion("1.0.*")] 24 | [assembly: AssemblyVersion(Version)] 25 | [assembly: AssemblyFileVersion(Version)] 26 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 27 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(StudioSceneNavigationPlugin.StudioSceneNavigation))] 28 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(StudioSceneNavigationPlugin.StudioSceneNavigation))] 29 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 30 | -------------------------------------------------------------------------------- /src/StudioSceneNavigation/KK_StudioSceneNavigation/KK.StudioSceneNavigation.cs: -------------------------------------------------------------------------------- 1 | namespace StudioSceneNavigationPlugin 2 | { 3 | public partial class StudioSceneNavigation 4 | { 5 | private const int ImagesPerPage = 12; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/StudioSceneNavigation/KK_StudioSceneNavigation/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static StudioSceneNavigationPlugin.StudioSceneNavigation; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("9ae3fbcf-32d1-412e-8754-dbe1d3f0eb7c")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(StudioSceneNavigationPlugin.StudioSceneNavigation))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(StudioSceneNavigationPlugin.StudioSceneNavigation))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/StudioSceneNavigation/KK_StudioSceneNavigation/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/TranslationCacheCleaner/AI_TranslationCacheCleaner/AI.TranslationCacheCleaner.cs: -------------------------------------------------------------------------------- 1 | namespace TranslationCacheCleanerPlugin 2 | { 3 | public partial class TranslationCacheCleaner { } 4 | } 5 | -------------------------------------------------------------------------------- /src/TranslationCacheCleaner/AI_TranslationCacheCleaner/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static TranslationCacheCleanerPlugin.TranslationCacheCleaner; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("bdc74c54-2ca0-4dc7-b783-0dab04bbf16a")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationCacheCleanerPlugin.TranslationCacheCleaner))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationCacheCleanerPlugin.TranslationCacheCleaner))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/TranslationCacheCleaner/Core_TranslationCacheCleaner/Core_TranslationCacheCleaner.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | e268c317-7402-4376-9adb-1c6b272a8789 7 | 8 | 9 | TranslationCacheCleanerPlugin 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/TranslationCacheCleaner/Core_TranslationCacheCleaner/Core_TranslationCacheCleaner.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | e268c317-7402-4376-9adb-1c6b272a8789 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/TranslationCacheCleaner/HS2_TranslationCacheCleaner/HS2.TranslationCacheCleaner.cs: -------------------------------------------------------------------------------- 1 | namespace TranslationCacheCleanerPlugin 2 | { 3 | public partial class TranslationCacheCleaner { } 4 | } 5 | -------------------------------------------------------------------------------- /src/TranslationCacheCleaner/HS2_TranslationCacheCleaner/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static TranslationCacheCleanerPlugin.TranslationCacheCleaner; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("5e80c7ec-d14a-490b-8f3c-70c4956a911d")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | // Version information for an assembly consists of the following four values: 24 | // 25 | // Major Version 26 | // Minor Version 27 | // Build Number 28 | // Revision 29 | // 30 | // You can specify all the values or you can default the Build and Revision Numbers 31 | // by using the '*' as shown below: 32 | // [assembly: AssemblyVersion("1.0.*")] 33 | [assembly: AssemblyVersion(Version)] 34 | [assembly: AssemblyFileVersion(Version)] 35 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 36 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationCacheCleanerPlugin.TranslationCacheCleaner))] 37 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationCacheCleanerPlugin.TranslationCacheCleaner))] 38 | 39 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 40 | -------------------------------------------------------------------------------- /src/TranslationCacheCleaner/KKS_TranslationCacheCleaner/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static TranslationCacheCleanerPlugin.TranslationCacheCleaner; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("d67b9aef-16c0-405f-8a89-7ebed4249d9e")] 12 | // Version information for an assembly consists of the following four values: 13 | // 14 | // Major Version 15 | // Minor Version 16 | // Build Number 17 | // Revision 18 | // 19 | // You can specify all the values or you can default the Build and Revision Numbers 20 | // by using the '*' as shown below: 21 | // [assembly: AssemblyVersion("1.0.*")] 22 | [assembly: AssemblyVersion(Version)] 23 | [assembly: AssemblyFileVersion(Version)] 24 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 25 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationCacheCleanerPlugin.TranslationCacheCleaner))] 26 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationCacheCleanerPlugin.TranslationCacheCleaner))] 27 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 28 | -------------------------------------------------------------------------------- /src/TranslationCacheCleaner/KK_TranslationCacheCleaner/KK.TranslationCacheCleaner.cs: -------------------------------------------------------------------------------- 1 | namespace TranslationCacheCleanerPlugin 2 | { 3 | public partial class TranslationCacheCleaner { } 4 | } 5 | -------------------------------------------------------------------------------- /src/TranslationCacheCleaner/KK_TranslationCacheCleaner/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static TranslationCacheCleanerPlugin.TranslationCacheCleaner; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("be2077d1-1271-4f7f-89b4-1bb49d07f98b")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationCacheCleanerPlugin.TranslationCacheCleaner))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationCacheCleanerPlugin.TranslationCacheCleaner))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/TranslationCacheCleaner/KK_TranslationCacheCleaner/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/TranslationCacheCleaner/README.md: -------------------------------------------------------------------------------- 1 | # TranslationCacheCleaner 2 | 3 | Removes all entries from your translation cache file that would be translated by existing translations. Useful when translation files are updated to ensure you aren't still getting old translations from your cache. 4 | 5 | ## Supported Games 6 | 7 | | | Game | Studio | Download | 8 | | ----------------------: | :---: | :-----: | ------------ | 9 | | Koikatu/Koikatsu Party | ✔️ | ✔️ | [KK_TranslationCacheCleaner] | 10 | | AI-Shoujo/AI-Syoujyo | ✔️ | ✔️ | [AI_TranslationCacheCleaner] | 11 | | Honey Select 2 | ✔️ | ✔️ | [HS2_TranslationCacheCleaner] | 12 | 13 | 14 | ## Technical Info 15 | 16 | ### Dependencies 17 | 18 | - [GeBoCommon](https://github.com/GeBo1/GeBoPlugins) 19 | - [XUnity.AutoTranslator](https://github.com/bbepis/XUnity.AutoTranslator) v4.16.0+ 20 | - [BepInEx](https://github.com/BepInEx/BepInEx) v5.4.8+ 21 | 22 | [//]: # (## Latest Links) 23 | 24 | [AI_TranslationCacheCleaner]: https://github.com/GeBo1/GeBoPlugins/releases/download/r32/AI_TranslationCacheCleaner.v0.6.0.2.zip "v0.6.0.2" 25 | [HS2_TranslationCacheCleaner]: https://github.com/GeBo1/GeBoPlugins/releases/download/r32/HS2_TranslationCacheCleaner.v0.6.0.2.zip "v0.6.0.2" 26 | [KK_TranslationCacheCleaner]: https://github.com/GeBo1/GeBoPlugins/releases/download/r32/KK_TranslationCacheCleaner.v0.6.0.2.zip "v0.6.0.2" 27 | -------------------------------------------------------------------------------- /src/TranslationHelper/AILike_TranslationHelper/AILike.TranslationHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using BepInEx.Configuration; 3 | using UnityEngine.Assertions; 4 | 5 | namespace TranslationHelperPlugin 6 | { 7 | public partial class TranslationHelper 8 | { 9 | public static ConfigEntry AILike_SplitNamesBeforeTranslate { get; private set; } 10 | 11 | 12 | internal void AILikeAwake() 13 | { 14 | AILike_SplitNamesBeforeTranslate = Config.Bind("Translate Card Name Options", 15 | "Split Names Before Translate", 16 | true, "Split on space and translate names by sections"); 17 | AILike_SplitNamesBeforeTranslate.SettingChanged += AILike_SplitNamesBeforeTranslate_SettingChanged; 18 | SplitNamesBeforeTranslate = AILike_SplitNamesBeforeTranslate.Value; 19 | } 20 | 21 | internal void AILikeStart() 22 | { 23 | Assert.IsNotNull(this); 24 | } 25 | 26 | private static void AILike_SplitNamesBeforeTranslate_SettingChanged(object sender, EventArgs e) 27 | { 28 | SplitNamesBeforeTranslate = AILike_SplitNamesBeforeTranslate.Value; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/TranslationHelper/AILike_TranslationHelper/AILike_TranslationHelper.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 7a0f3c5c-2ebc-4cd3-9fa8-e827d0e787d6 7 | 8 | 9 | TranslationHelperPlugin 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/TranslationHelper/AILike_TranslationHelper/AILike_TranslationHelper.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {65E7C5C7-24E3-49DF-A62E-51CD57350C88} 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/TranslationHelper/AILike_TranslationHelper/Acceleration/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using HarmonyLib; 3 | using UnityEngine.Assertions; 4 | 5 | namespace TranslationHelperPlugin.Acceleration 6 | { 7 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 8 | internal static partial class Configuration 9 | { 10 | internal static void GameSpecificSetup(Harmony harmony) 11 | { 12 | Assert.IsNotNull(harmony); 13 | 14 | #if AI 15 | AI_GameSpecificSetup(harmony); 16 | #endif 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/TranslationHelper/AILike_TranslationHelper/Acceleration/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace TranslationHelperPlugin.Acceleration 4 | { 5 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 6 | internal static partial class Hooks { } 7 | } 8 | -------------------------------------------------------------------------------- /src/TranslationHelper/AILike_TranslationHelper/Chara/Configuration.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine.Assertions; 3 | 4 | namespace TranslationHelperPlugin.Chara 5 | { 6 | internal static partial class Configuration 7 | { 8 | internal static void GameSpecificSetup(Harmony harmony) 9 | { 10 | Assert.IsNotNull(harmony); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/TranslationHelper/AILike_TranslationHelper/Chara/Extensions.cs: -------------------------------------------------------------------------------- 1 | namespace TranslationHelperPlugin.Chara 2 | { 3 | public static partial class Extensions 4 | { 5 | private static readonly string[] FullNameNameTypes = { "fullname" }; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/TranslationHelper/AILike_TranslationHelper/MainGame/Configuration.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine.Assertions; 3 | 4 | namespace TranslationHelperPlugin.MainGame 5 | { 6 | internal static partial class Configuration 7 | { 8 | internal static void GameSpecificSetup(Harmony harmony) 9 | { 10 | Assert.IsNotNull(harmony); 11 | #if AI 12 | AI_GameSpecificSetup(harmony); 13 | #elif HS2 14 | //HS2_GameSpecificSetup(harmony); 15 | #endif 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/TranslationHelper/AILike_TranslationHelper/Maker/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Diagnostics.CodeAnalysis; 5 | using CharaCustom; 6 | using HarmonyLib; 7 | using KKAPI.Maker; 8 | using TranslationHelperPlugin.Chara; 9 | using UnityEngine.Assertions; 10 | 11 | namespace TranslationHelperPlugin.Maker 12 | { 13 | internal static partial class Configuration 14 | { 15 | /* 16 | internal static Text MakerTextFullName 17 | { 18 | get 19 | { 20 | var makerBase = MakerAPI.GetMakerBase(); 21 | if (makerBase == null || makerBase.customCtrl == null) return null; 22 | return Traverse.Create(makerBase.customCtrl).Field("textFullName")?.Value; 23 | } 24 | } 25 | */ 26 | 27 | internal static void GameSpecificSetup(Harmony harmony) 28 | { 29 | Assert.IsNotNull(harmony); 30 | MakerAPI.MakerExiting += CleanupHandler; 31 | TranslationHelper.BehaviorChanged += CleanupHandler; 32 | } 33 | 34 | private static void CleanupHandler(object sender, EventArgs e) 35 | { 36 | Hooks.ResetTranslatingCallbacks(); 37 | } 38 | 39 | private static IEnumerable> GetNameInputFieldInfos() 40 | { 41 | yield return new KeyValuePair("fullname", new[] { "O_Chara", "Setting", "InputField" }); 42 | } 43 | 44 | [SuppressMessage("ReSharper", "ParameterOnlyUsedForPreconditionCheck.Local")] 45 | private static IEnumerator GameSpecificUpdateUICoroutine(Controller controller) 46 | { 47 | Assert.IsNotNull(controller); 48 | var makerBase = MakerAPI.GetMakerBase(); 49 | if (makerBase == null) yield break; 50 | makerBase.customCtrl.UpdateCharaNameText(); 51 | foreach (var element in makerBase.GetComponentsInChildren()) 52 | { 53 | element.SafeProcObject(o => o.UpdateCustomUI()); 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/TranslationHelper/AILike_TranslationHelper/Studio/Configuration.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine.Assertions; 3 | 4 | namespace TranslationHelperPlugin.Studio 5 | { 6 | internal static partial class Configuration 7 | { 8 | internal static void GameSpecificSetup(Harmony harmony) 9 | { 10 | Assert.IsNotNull(harmony); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/TranslationHelper/AILike_TranslationHelper/Utils/CharaFileInfoWrapper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using GeBoCommon.Chara; 4 | using GeBoCommon.Utilities; 5 | 6 | namespace TranslationHelperPlugin.Utils 7 | { 8 | static partial class CharaFileInfoWrapper 9 | { 10 | private static readonly string 11 | MalePathKey = PathUtils.CombinePaths(string.Empty, "chara", "male", string.Empty).ToLowerInvariant(); 12 | 13 | private static readonly string 14 | FemalePathKey = PathUtils.CombinePaths(string.Empty, "chara", "female", string.Empty).ToLowerInvariant(); 15 | 16 | internal static CharacterSex GuessSex(this ICharaFileInfo fileInfo) 17 | { 18 | var filename = Path.GetFileName(fileInfo.FullPath); 19 | 20 | if (filename.StartsWith("AISChaM_", StringComparison.OrdinalIgnoreCase) || 21 | filename.StartsWith("ais_m_", StringComparison.OrdinalIgnoreCase) || 22 | filename.StartsWith("HS2ChaM_", StringComparison.OrdinalIgnoreCase) || 23 | filename.StartsWith("HS2_ill_M_", StringComparison.OrdinalIgnoreCase)) 24 | { 25 | return CharacterSex.Male; 26 | } 27 | 28 | if (filename.StartsWith("AISChaF", StringComparison.OrdinalIgnoreCase) || 29 | filename.StartsWith("ais_f_", StringComparison.OrdinalIgnoreCase) || 30 | filename.StartsWith("HS2ChaF_", StringComparison.OrdinalIgnoreCase) || 31 | filename.StartsWith("HS2_ill_F_", StringComparison.OrdinalIgnoreCase)) 32 | { 33 | return CharacterSex.Female; 34 | } 35 | 36 | var path = PathUtils.NormalizePath(fileInfo.FullPath).ToLowerInvariant(); 37 | Logger.LogDebug($"{nameof(GuessSex)}: {fileInfo}: {path}"); 38 | return path.Contains(MalePathKey) 39 | ? CharacterSex.Male 40 | : path.Contains(FemalePathKey) 41 | ? CharacterSex.Female 42 | : CharacterSex.Unspecified; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/TranslationHelper/AI_TranslationHelper/AI.TranslationHelper.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | using UnityEngine.SceneManagement; 3 | 4 | namespace TranslationHelperPlugin 5 | { 6 | [BepInPlugin(GUID, PluginName, Version)] 7 | public partial class TranslationHelper : BaseUnityPlugin 8 | { 9 | internal void GameSpecificAwake() 10 | { 11 | AILikeAwake(); 12 | 13 | // set up for new game dialogs 14 | SceneManager.sceneLoaded += AI_SceneManager_sceneLoaded; 15 | SceneManager.sceneUnloaded += AI_SceneManager_sceneUnloaded; 16 | } 17 | 18 | internal void GameSpecificStart() 19 | { 20 | AILikeStart(); 21 | } 22 | 23 | private void AI_SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) 24 | { 25 | if (arg0.name == "Title_Load") TreatUnknownAsGameMode = true; 26 | } 27 | 28 | private void AI_SceneManager_sceneUnloaded(Scene arg0) 29 | { 30 | if (arg0.name == "Title_Load") TreatUnknownAsGameMode = false; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/TranslationHelper/AI_TranslationHelper/Acceleration/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using AIProject; 4 | using AIProject.Animal; 5 | using AIProject.UI; 6 | using HarmonyLib; 7 | using UnityEngine.Assertions; 8 | 9 | namespace TranslationHelperPlugin.Acceleration 10 | { 11 | internal static partial class Configuration 12 | { 13 | internal static readonly Dictionary ConfirmSceneSentenceTranslations = 14 | new Dictionary(); 15 | 16 | internal static readonly HashSet ConfirmSceneSentenceHandled = new HashSet(); 17 | 18 | internal static void AI_GameSpecificSetup(Harmony harmony) 19 | { 20 | Assert.IsNotNull(harmony); 21 | TranslationHelper.AccelerationBehaviorChanged += AI_AccelerationBehaviorChanged; 22 | ResetCaches(); 23 | 24 | StringMethodTranspilerHelper.PatchMethod(harmony, typeof(WildGround), 25 | nameof(WildGround.InitializeCommandLabels)); 26 | StringMethodTranspilerHelper.PatchMethod(harmony, typeof(AgentActor), nameof(AgentActor.InitCommands)); 27 | StringMethodTranspilerHelper.PatchMethod(harmony, typeof(PetHomeUI), nameof(PetHomeUI.RemoveAnimal)); 28 | } 29 | 30 | private static void AI_AccelerationBehaviorChanged(object sender, EventArgs e) 31 | { 32 | ResetCaches(); 33 | } 34 | 35 | private static void ResetCaches() 36 | { 37 | ConfirmSceneSentenceHandled.Clear(); 38 | ConfirmSceneSentenceTranslations.Clear(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/TranslationHelper/AI_TranslationHelper/MainGame/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using AIProject; 3 | using GeBoCommon.Utilities; 4 | using HarmonyLib; 5 | 6 | namespace TranslationHelperPlugin.MainGame 7 | { 8 | internal static partial class Hooks 9 | { 10 | [HarmonyPostfix] 11 | [HarmonyPatch(typeof(MerchantActor), nameof(MerchantActor.CharaName), MethodType.Getter)] 12 | internal static void MerchantActorCharaNameGetterPostfix(ref string __result) 13 | { 14 | try 15 | { 16 | __result = Configuration.MerchantCharaName.IsNullOrEmpty() 17 | ? __result 18 | : Configuration.MerchantCharaName; 19 | } 20 | 21 | catch (Exception err) 22 | { 23 | Logger.LogException(err, nameof(MerchantActorCharaNameGetterPostfix)); 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/TranslationHelper/AI_TranslationHelper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static TranslationHelperPlugin.TranslationHelper; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("a412dd33-e3cf-4af0-9c17-9a918947b10b")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationHelperPlugin.TranslationHelper))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationHelperPlugin.TranslationHelper))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/TranslationHelper/AI_TranslationHelper/Translation/Configuration.cs: -------------------------------------------------------------------------------- 1 | using GameLoadCharaFileSystem; 2 | using HarmonyLib; 3 | using TranslationHelperPlugin.Utils; 4 | using UnityEngine.Assertions; 5 | 6 | namespace TranslationHelperPlugin.Translation 7 | 8 | { 9 | internal static partial class Configuration 10 | { 11 | internal static void GameSpecificSetup(Harmony harmony) 12 | { 13 | Assert.IsNotNull(harmony); 14 | CharaFileInfoWrapper.RegisterWrapperType(typeof(GameCharaFileInfo), typeof(GameCharaFileInfoWrapper)); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/TranslationHelper/AI_TranslationHelper/Utils/GameCharaFileInfoWrapper.cs: -------------------------------------------------------------------------------- 1 | using GameLoadCharaFileSystem; 2 | using GeBoCommon.Chara; 3 | 4 | namespace TranslationHelperPlugin.Utils 5 | { 6 | // GameLoadCharaFileSystem.GameCharaFileInfo 7 | internal class GameCharaFileInfoWrapper : ICharaFileInfo 8 | { 9 | private readonly GameCharaFileInfo _target; 10 | 11 | public GameCharaFileInfoWrapper(GameCharaFileInfo gameCharaFileInfo) 12 | { 13 | _target = gameCharaFileInfo; 14 | } 15 | 16 | public int Index => _target.index; 17 | 18 | public string Name 19 | { 20 | get => _target.name; 21 | set => _target.name = value; 22 | } 23 | 24 | public string FullPath => _target.FullPath; 25 | 26 | public CharacterSex Sex 27 | { 28 | get 29 | { 30 | try 31 | { 32 | return (CharacterSex)_target.sex; 33 | } 34 | catch 35 | { 36 | return this.GuessSex(); 37 | } 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Acceleration/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using BepInEx.Configuration; 4 | using BepInEx.Logging; 5 | 6 | namespace TranslationHelperPlugin.Acceleration 7 | { 8 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 9 | internal static partial class Configuration 10 | { 11 | internal static ManualLogSource Logger => TranslationHelper.Logger; 12 | private static ConfigEntry EnableAcceleration { get; set; } 13 | 14 | internal static bool AccelerationEnabled { get; private set; } 15 | 16 | internal static void Setup() 17 | { 18 | Logger.LogDebug($"{typeof(Configuration).FullName}.{nameof(Setup)}"); 19 | 20 | 21 | EnableAcceleration = TranslationHelper.Instance.Config.Bind("Acceleration", "Enable", true, 22 | "Enable game specific optimizations"); 23 | EnableAcceleration.SettingChanged += EnableAcceleration_SettingChanged; 24 | EnableAcceleration_SettingChanged(null, EventArgs.Empty); 25 | 26 | var harmony = Hooks.SetupHooks(); 27 | 28 | GameSpecificSetup(harmony); 29 | } 30 | 31 | private static void EnableAcceleration_SettingChanged(object sender, EventArgs e) 32 | { 33 | AccelerationEnabled = EnableAcceleration.Value; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Acceleration/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using BepInEx.Logging; 3 | using HarmonyLib; 4 | using JetBrains.Annotations; 5 | 6 | namespace TranslationHelperPlugin.Acceleration 7 | { 8 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 9 | internal static partial class Hooks 10 | { 11 | [UsedImplicitly] 12 | internal static ManualLogSource Logger => TranslationHelper.Logger; 13 | 14 | internal static Harmony SetupHooks() 15 | { 16 | return Harmony.CreateAndPatchAll(typeof(Hooks)); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Core_TranslationHelper.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | fa213cea-3166-4258-b3eb-0931880fb310 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Delegates.cs: -------------------------------------------------------------------------------- 1 | using GeBoCommon.AutoTranslation; 2 | using JetBrains.Annotations; 3 | using Studio; 4 | #if AI||HS2 5 | #endif 6 | 7 | namespace TranslationHelperPlugin 8 | { 9 | public delegate void TranslationResultHandler(ITranslationResult translationResult); 10 | 11 | // Slow implementations should return false immediately when fast == true 12 | public delegate bool TryAlternateStudioCharaLoaderTranslation(NameScope sexOnlyScope, CharaFileInfo charaFileInfo, 13 | string originalName, bool fast); 14 | 15 | [PublicAPI] 16 | public delegate NameScope NameScopeGetter(); 17 | } 18 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Enums.cs: -------------------------------------------------------------------------------- 1 | namespace TranslationHelperPlugin 2 | { 3 | public enum CardLoadTranslationMode 4 | { 5 | Disabled, 6 | CacheOnly, 7 | FullyEnabled 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using BepInEx.Logging; 4 | using GeBoCommon.AutoTranslation; 5 | using GeBoCommon.Utilities; 6 | using HarmonyLib; 7 | 8 | namespace TranslationHelperPlugin 9 | { 10 | internal static class Extensions 11 | { 12 | private static ManualLogSource Logger => TranslationHelper.Logger; 13 | 14 | internal static void CallHandlers(this IEnumerable handlers, 15 | ITranslationResult result) 16 | { 17 | foreach (var handler in handlers) 18 | { 19 | try 20 | { 21 | Logger.DebugLogDebug($"{nameof(CallHandlers)}: {handler.Method.FullDescription()}"); 22 | handler(result); 23 | } 24 | catch (Exception err) 25 | { 26 | Logger.LogException(err, $"{nameof(CallHandlers)}: Error executing {handler.Method}"); 27 | } 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/MainGame/Controller.cs: -------------------------------------------------------------------------------- 1 | #if AI||KKS||KK 2 | using System; 3 | using System.Diagnostics.CodeAnalysis; 4 | using BepInEx.Logging; 5 | using KKAPI.MainGame; 6 | 7 | namespace TranslationHelperPlugin.MainGame 8 | { 9 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 10 | public partial class Controller : GameCustomFunctionController 11 | { 12 | internal static ManualLogSource Logger => TranslationHelper.Logger; 13 | 14 | protected override void OnGameLoad(GameSaveLoadEventArgs args) 15 | { 16 | TranslationHelper.RegistrationManager.Cleanup(); 17 | Configuration.OnGameLoad(this, args); 18 | base.OnGameLoad(args); 19 | } 20 | 21 | protected override void OnGameSave(GameSaveLoadEventArgs args) 22 | { 23 | Configuration.OnGameSave(this, args); 24 | base.OnGameSave(args); 25 | } 26 | 27 | protected override void OnNewGame() 28 | { 29 | Configuration.OnNewGame(this, EventArgs.Empty); 30 | base.OnNewGame(); 31 | } 32 | } 33 | } 34 | #endif 35 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/MainGame/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using BepInEx.Logging; 3 | using HarmonyLib; 4 | 5 | namespace TranslationHelperPlugin.MainGame 6 | { 7 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 8 | internal partial class Hooks 9 | { 10 | internal static ManualLogSource Logger => TranslationHelper.Logger; 11 | 12 | internal static Harmony SetupHooks() 13 | { 14 | return Harmony.CreateAndPatchAll(typeof(Hooks)); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Maker/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using BepInEx.Logging; 3 | using HarmonyLib; 4 | #if AI||HS2 5 | #endif 6 | 7 | namespace TranslationHelperPlugin.Maker 8 | { 9 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 10 | internal partial class Hooks 11 | { 12 | internal static ManualLogSource Logger => TranslationHelper.Logger; 13 | 14 | internal static Harmony SetupHooks() 15 | { 16 | return Harmony.CreateAndPatchAll(typeof(Hooks)); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/NameScope.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using GeBoCommon.Chara; 3 | using JetBrains.Annotations; 4 | 5 | namespace TranslationHelperPlugin 6 | { 7 | public class NameScope : IEquatable 8 | { 9 | internal const int BaseScope = 8192; 10 | 11 | public static readonly NameScope DefaultNameScope = new NameScope(); 12 | 13 | public NameScope(CharacterSex sex, NameType nameType = NameType.Unclassified) 14 | { 15 | NameType = nameType; 16 | Sex = sex; 17 | TranslationScope = BaseScope + ((int)NameType * 16) + (int)Sex + 1; 18 | } 19 | 20 | [PublicAPI] 21 | public NameScope(NameType nameType) : this(CharacterSex.Unspecified, nameType) { } 22 | 23 | public NameScope() : this(CharacterSex.Unspecified) { } 24 | public int TranslationScope { get; } 25 | public NameType NameType { get; } 26 | public CharacterSex Sex { get; } 27 | 28 | public bool Equals(NameScope other) 29 | { 30 | if (ReferenceEquals(null, other)) return false; 31 | if (ReferenceEquals(this, other)) return true; 32 | return TranslationScope == other.TranslationScope; 33 | } 34 | 35 | public override bool Equals(object obj) 36 | { 37 | if (ReferenceEquals(null, obj)) return false; 38 | if (ReferenceEquals(this, obj)) return true; 39 | return obj.GetType() == GetType() && Equals((NameScope)obj); 40 | } 41 | 42 | public override int GetHashCode() 43 | { 44 | return TranslationScope; 45 | } 46 | 47 | public override string ToString() 48 | { 49 | return $"NameScope({Sex}, {NameType}, {TranslationScope})"; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/NameScopeDictionary.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace TranslationHelperPlugin 5 | { 6 | internal class NameScopeDictionary where T : new() 7 | { 8 | private readonly Dictionary _dictionary = new Dictionary(); 9 | private readonly Func _initializer; 10 | private readonly object _lock = new object(); 11 | 12 | public NameScopeDictionary(Func initializer = null) 13 | { 14 | _initializer = initializer; 15 | } 16 | 17 | public T this[NameScope key] 18 | { 19 | get 20 | { 21 | lock (_lock) 22 | { 23 | return _dictionary.TryGetValue(key, out var result) ? result : InitializeScope(key); 24 | } 25 | } 26 | } 27 | 28 | private T InitializeScope(NameScope scope) 29 | { 30 | var result = _initializer != null ? _initializer() : new T(); 31 | lock (_lock) 32 | { 33 | _dictionary[scope] = result; 34 | } 35 | 36 | return result; 37 | } 38 | 39 | public IEnumerable GetScopes() 40 | { 41 | lock (_lock) 42 | { 43 | return _dictionary.Keys; 44 | } 45 | } 46 | 47 | public void Clear() 48 | { 49 | lock (_lock) 50 | { 51 | _dictionary.Clear(); 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Presets/CardNameCacheBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using GeBoCommon.Utilities; 4 | 5 | namespace TranslationHelperPlugin.Presets 6 | { 7 | internal interface ICardNameCacheBase 8 | { 9 | string FamilyName { get; } 10 | string GivenName { get; } 11 | string FullName { get; } 12 | } 13 | 14 | public abstract class CardNameCacheBase : ICardNameCacheBase, IEquatable 15 | { 16 | protected static readonly IEqualityComparer IdentityComparer = new TrimmedStringComparer(); 17 | internal abstract string Identity { get; } 18 | 19 | public abstract string FamilyName { get; } 20 | 21 | public abstract string GivenName { get; } 22 | 23 | public abstract string FullName { get; } 24 | 25 | public bool Equals(CardNameCacheBase other) 26 | { 27 | if (ReferenceEquals(null, other)) return false; 28 | return ReferenceEquals(this, other) || IdentityComparer.Equals(Identity, other.Identity); 29 | } 30 | 31 | 32 | public override bool Equals(object obj) 33 | { 34 | if (ReferenceEquals(null, obj)) return false; 35 | return ReferenceEquals(this, obj) || ( 36 | obj.GetType() == GetType() && Equals((CardNameCacheBase)obj)); 37 | } 38 | 39 | public override int GetHashCode() 40 | { 41 | return Identity != null ? Identity.GetHashCode() : 0; 42 | } 43 | 44 | public override string ToString() 45 | { 46 | return $"{this.GetPrettyTypeName()}({Identity})"; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Presets/CardNameCacheKey.cs: -------------------------------------------------------------------------------- 1 | #if KK||KKS 2 | using GeBoCommon.Chara; 3 | #endif 4 | using JetBrains.Annotations; 5 | #if AI||HS2 6 | using AIChara; 7 | using TranslationHelperPlugin.Chara; 8 | #endif 9 | 10 | namespace TranslationHelperPlugin.Presets 11 | { 12 | public class CardNameCacheKey : CardNameCacheData 13 | { 14 | internal CardNameCacheKey(string familyName, string givenName) : base(familyName, givenName) { } 15 | 16 | [UsedImplicitly] 17 | internal CardNameCacheKey(string fullName) : base(fullName) { } 18 | 19 | #if KK || KKS 20 | internal CardNameCacheKey(ChaFile chaFile) : 21 | this(chaFile.GetName("lastname"), chaFile.GetName("firstname")) { } 22 | #else 23 | internal CardNameCacheKey(ChaFile chaFile) : this(chaFile.GetOriginalFullName()) { } 24 | #endif 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Presets/CardNameCacheValue.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | 3 | namespace TranslationHelperPlugin.Presets 4 | { 5 | internal class CardNameCacheValue : CardNameCacheData 6 | { 7 | internal CardNameCacheValue(string familyName, string givenName) : base(familyName, givenName) { } 8 | 9 | [UsedImplicitly] 10 | internal CardNameCacheValue(string fullName) : base(fullName) { } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Presets/Data/NamePreset.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Xml.Serialization; 5 | using BepInEx.Logging; 6 | using GeBoCommon.Chara; 7 | 8 | namespace TranslationHelperPlugin.Presets.Data 9 | { 10 | [Serializable] 11 | [XmlRoot(Namespace = "", IsNullable = true)] 12 | public class NamePreset 13 | { 14 | internal static ManualLogSource Logger => TranslationHelper.Logger; 15 | 16 | public CharacterSex Sex { get; set; } = CharacterSex.Unspecified; 17 | 18 | [XmlArray] 19 | [XmlArrayItem(ElementName = "Name")] 20 | public List GivenNames { get; } = new List(); 21 | 22 | [XmlArray] 23 | [XmlArrayItem(ElementName = "Name")] 24 | public List FamilyNames { get; } = new List(); 25 | 26 | [XmlArray] 27 | [XmlArrayItem(ElementName = "Name")] 28 | public List NickNames { get; } = new List(); 29 | 30 | [XmlArrayItem(ElementName = "Translation")] 31 | public List Translations { get; } = new List(); 32 | 33 | public string Notes { get; set; } 34 | 35 | internal NameTranslation GetTranslation(string locale) 36 | { 37 | NameTranslation result = null; 38 | foreach (var translation in Translations) 39 | { 40 | if (translation.TargetLanguages.Count == 0) 41 | { 42 | if (result == null) result = translation; 43 | continue; 44 | } 45 | 46 | if (!translation.TargetLanguages.Contains(locale, StringComparer.OrdinalIgnoreCase)) continue; 47 | return translation; 48 | } 49 | 50 | return result; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Presets/Data/NameTranslation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Xml.Serialization; 4 | 5 | namespace TranslationHelperPlugin.Presets.Data 6 | { 7 | [SerializableAttribute] 8 | public class NameTranslation 9 | { 10 | [XmlArray] 11 | [XmlArrayItemAttribute("Language")] 12 | public List TargetLanguages { get; } = new List(); 13 | 14 | public string GivenName { get; set; } 15 | public string FamilyName { get; set; } 16 | public string NickName { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Resources/NamePresets/AI/NPCs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Female 7 | 商人 8 | 9 | シャン 10 | 11 | 12 | 13 | 14 | en 15 | 16 | Merchant 17 | Shan 18 | 19 | 20 | AI NPC 21 | 22 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Resources/NamePresets/AI/StockMale.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Male 6 | 7 | 主人公 8 | 9 | 10 | 11 | 12 | en 13 | 14 | Hero 15 | 16 | 17 | AI Stock Character (default) 18 | 19 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Resources/NamePresets/HS2/NPCs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Female 7 | 8 | フュル 9 | 10 | 11 | 12 | 13 | en 14 | 15 | Fur 16 | 17 | 18 | HS2 NPC 19 | 20 | 21 | 22 | Female 23 | 24 | シトリー 25 | 26 | 27 | 28 | 29 | en 30 | 31 | Sitri 32 | 33 | 34 | HS2 NPC 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Resources/NamePresets/KK/StockMale.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Male 7 | 8 | 壮亮 9 | 10 | 11 | 柏木 12 | 13 | 14 | 15 | 16 | en 17 | 18 | Sousuke 19 | Kashiwagi 20 | 21 | 22 | KK Stock Character 23 | 24 | 25 | 26 | Male 27 | 28 | ロイ 29 | 30 | 31 | 北条 32 | 33 | 34 | 35 | 36 | en 37 | 38 | Roy 39 | Houjou 40 | 41 | 42 | KK Stock Character 43 | 44 | 45 | 46 | Male 47 | 48 | 拓磨 49 | 50 | 51 | 近藤 52 | 53 | 54 | 55 | 56 | en 57 | 58 | Takuma 59 | Kondo 60 | 61 | 62 | KK Stock Character 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Resources/NamePresets/KKS/NPCs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Female 7 | 8 | 9 | 10 | 11 | 玉城 12 | 13 | 14 | ゆう 15 | 16 | 17 | 18 | 19 | en 20 | 21 | Yuu 22 | Tamaki 23 | Yuu 24 | 25 | 26 | KKS NPC 27 | 28 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Resources/NamePresets/KKS/StockFemale.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Female 9 | 10 | 11 | 12 | 13 | 玉城 14 | 15 | 16 | ゆう 17 | 18 | 19 | 20 | 21 | en 22 | 23 | Yuu 24 | Tamaki 25 | Yuu 26 | 27 | 28 | KKS stock character 29 | 30 | 31 | 32 | Female 33 | 34 | 里沙 35 | 36 | 37 | 伊丹 38 | 39 | 40 | リサ 41 | 42 | 43 | 44 | 45 | en 46 | 47 | Risa 48 | Itami 49 | Risa 50 | 51 | 52 | KKS stock character 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Translation/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using BepInEx.Logging; 3 | 4 | namespace TranslationHelperPlugin.Translation 5 | { 6 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 7 | internal static partial class Configuration 8 | { 9 | internal static ManualLogSource Logger => TranslationHelper.Logger; 10 | 11 | internal static void Setup() 12 | { 13 | Logger.LogDebug($"{typeof(Configuration).FullName}.{nameof(Setup)}"); 14 | var harmony = Hooks.SetupHooks(); 15 | 16 | GameSpecificSetup(harmony); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Translation/Handlers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using GeBoCommon.AutoTranslation; 4 | 5 | namespace TranslationHelperPlugin.Translation 6 | { 7 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 8 | public static partial class Handlers 9 | { 10 | public static TranslationResultHandler CallbackWrapper(Action callback, string failureValue = null) 11 | { 12 | void Handler(ITranslationResult result) 13 | { 14 | callback(result.Succeeded ? result.TranslatedText : failureValue); 15 | } 16 | 17 | return Handler; 18 | } 19 | 20 | public static TranslationResultHandler FileInfoCacheHandler(NameScope scope, string path, string originalName) 21 | { 22 | void Handler(ITranslationResult result) 23 | { 24 | if (!result.Succeeded || string.IsNullOrEmpty(path) || 25 | TranslationHelper.NameStringComparer.Equals(result.TranslatedText, originalName)) 26 | { 27 | return; 28 | } 29 | 30 | CharaFileInfoTranslationManager.CacheRecentTranslation(scope, path, result.TranslatedText); 31 | } 32 | 33 | return Handler; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Translation/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using BepInEx.Logging; 3 | using HarmonyLib; 4 | 5 | namespace TranslationHelperPlugin.Translation 6 | { 7 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 8 | internal static partial class Hooks 9 | { 10 | internal static ManualLogSource Logger => TranslationHelper.Logger; 11 | 12 | internal static Harmony SetupHooks() 13 | { 14 | return Harmony.CreateAndPatchAll(typeof(Hooks)); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Translation/NameTranslator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using BepInEx.Logging; 3 | using GeBoCommon; 4 | using GeBoCommon.AutoTranslation; 5 | using JetBrains.Annotations; 6 | 7 | namespace TranslationHelperPlugin.Translation 8 | { 9 | internal class NameTranslator 10 | { 11 | [UsedImplicitly] 12 | internal static ManualLogSource Logger => TranslationHelper.Logger; 13 | 14 | private static IAutoTranslationHelper AutoTranslationHelper => GeBoAPI.Instance.AutoTranslationHelper; 15 | 16 | public bool TryTranslateName(string untranslatedText, NameScope nameScope, out string translatedText) 17 | { 18 | return AutoTranslationHelper.TryTranslate(untranslatedText, nameScope.TranslationScope, 19 | out translatedText); 20 | } 21 | 22 | /* 23 | public bool TryTranslateName(string untranslatedText, out string translatedText) 24 | { 25 | return TryTranslateName(untranslatedText, NameType.General, out translatedText); 26 | } 27 | */ 28 | 29 | public void TranslateNameAsync(string untranslatedText, NameScope nameScope, 30 | Action onCompleted) 31 | { 32 | AutoTranslationHelper.TranslateAsync(untranslatedText, nameScope.TranslationScope, 33 | onCompleted); 34 | } 35 | 36 | /* 37 | public void TranslateNameAsync(string untranslatedText, Action onCompleted) 38 | { 39 | TranslateNameAsync(untranslatedText, NameType.General, onCompleted); 40 | } 41 | */ 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/TranslationResult.cs: -------------------------------------------------------------------------------- 1 | using GeBoCommon.AutoTranslation; 2 | 3 | namespace TranslationHelperPlugin 4 | { 5 | public class TranslationResult : SimpleTranslationResult 6 | { 7 | public TranslationResult(bool succeeded, string translatedText = null, string errorMessage = null) : 8 | base(succeeded, translatedText, errorMessage) { } 9 | 10 | public TranslationResult(string originalText, string translatedText = null, string errorMessage = null) : 11 | this( 12 | !string.IsNullOrEmpty(translatedText) && 13 | !TranslationHelper.NameStringComparer.Equals(originalText, translatedText), 14 | translatedText, errorMessage) { } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Utils/CacheFunctionHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using BepInEx.Logging; 4 | using GeBoCommon.Utilities; 5 | using UnityEngine; 6 | 7 | namespace TranslationHelperPlugin.Utils 8 | { 9 | internal class CacheFunctionHelper 10 | { 11 | private readonly HashSet _recentCalls; 12 | private float _lastCheck; 13 | private float _staleTime; 14 | 15 | internal CacheFunctionHelper() 16 | { 17 | _recentCalls = new HashSet(); 18 | _lastCheck = _staleTime = 0f; 19 | 20 | TranslationHelper.CardTranslationBehaviorChanged += TranslationHelper_BehaviorChanged; 21 | TranslationHelper.AccelerationBehaviorChanged += TranslationHelper_BehaviorChanged; 22 | } 23 | 24 | internal static ManualLogSource Logger => TranslationHelper.Logger; 25 | 26 | private void TranslationHelper_BehaviorChanged(object sender, EventArgs e) 27 | { 28 | Clear(); 29 | } 30 | 31 | private void FreshnessCheck() 32 | { 33 | if (Time.fixedUnscaledTime <= _lastCheck) return; 34 | if (Time.fixedUnscaledTime >= _staleTime && _recentCalls.Count > 0) 35 | { 36 | Logger?.DebugLogDebug($"FreshnessCheck clearing: {_recentCalls.Count}"); 37 | _recentCalls.Clear(); 38 | } 39 | 40 | _lastCheck = Time.fixedUnscaledTime; 41 | _staleTime = _lastCheck + 600f; 42 | } 43 | 44 | public bool WasCalledRecently(object key) 45 | { 46 | FreshnessCheck(); 47 | return _recentCalls.Contains(key); 48 | } 49 | 50 | public void RecordCall(object key) 51 | { 52 | FreshnessCheck(); 53 | _recentCalls.Add(key); 54 | } 55 | 56 | public void Clear() 57 | { 58 | _lastCheck = _staleTime = 0f; 59 | FreshnessCheck(); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/TranslationHelper/Core_TranslationHelper/Utils/ICharaFileInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using GeBoCommon.Chara; 3 | using JetBrains.Annotations; 4 | 5 | namespace TranslationHelperPlugin.Utils 6 | { 7 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 8 | public partial interface ICharaFileInfo 9 | { 10 | [PublicAPI] 11 | int Index { get; } 12 | 13 | [PublicAPI] 14 | string Name { get; set; } 15 | 16 | [PublicAPI] 17 | string FullPath { get; } 18 | 19 | [PublicAPI] 20 | CharacterSex Sex { get; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/TranslationHelper/HS2_TranslationHelper/HS2.TranslationHelper.cs: -------------------------------------------------------------------------------- 1 | using BepInEx; 2 | 3 | namespace TranslationHelperPlugin 4 | { 5 | [BepInPlugin(GUID, PluginName, Version)] 6 | public partial class TranslationHelper : BaseUnityPlugin 7 | { 8 | internal void GameSpecificAwake() 9 | { 10 | AILikeAwake(); 11 | } 12 | 13 | internal void GameSpecificStart() 14 | { 15 | AILikeStart(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/TranslationHelper/HS2_TranslationHelper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using static TranslationHelperPlugin.TranslationHelper; 4 | 5 | // Setting ComVisible to false makes the types in this assembly not visible 6 | // to COM components. If you need to access a type in this assembly from 7 | // COM, set the ComVisible attribute to true on that type. 8 | [assembly: ComVisible(false)] 9 | 10 | // The following GUID is for the ID of the typelib if this project is exposed to COM 11 | [assembly: Guid("945a3640-237b-4dac-9df1-bab021a20c8e")] 12 | 13 | // Version information for an assembly consists of the following four values: 14 | // 15 | // Major Version 16 | // Minor Version 17 | // Build Number 18 | // Revision 19 | // 20 | // You can specify all the values or you can default the Build and Revision Numbers 21 | // by using the '*' as shown below: 22 | // [assembly: AssemblyVersion("1.0.*")] 23 | [assembly: AssemblyVersion(Version)] 24 | [assembly: AssemblyFileVersion(Version)] 25 | [assembly: AssemblyDescription(PluginName + " for " + GeBoCommon.Constants.GameName)] 26 | [assembly: AssemblyTitle(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationHelperPlugin.TranslationHelper))] 27 | [assembly: AssemblyProduct(GeBoCommon.Constants.Prefix + "_" + nameof(TranslationHelperPlugin.TranslationHelper))] 28 | [assembly: AssemblyCompany(GeBoCommon.Constants.RepoUrl)] 29 | -------------------------------------------------------------------------------- /src/TranslationHelper/HS2_TranslationHelper/Translation/Configuration.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine.Assertions; 3 | 4 | namespace TranslationHelperPlugin.Translation 5 | 6 | { 7 | internal static partial class Configuration 8 | { 9 | internal static void GameSpecificSetup(Harmony harmony) 10 | { 11 | Assert.IsNotNull(harmony); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/TranslationHelper/HS2_TranslationHelper/Translation/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics.CodeAnalysis; 4 | using GameLoadCharaFileSystem; 5 | using GeBoCommon.Utilities; 6 | using HarmonyLib; 7 | 8 | namespace TranslationHelperPlugin.Translation 9 | { 10 | internal partial class Hooks 11 | { 12 | [HarmonyPrefix] 13 | [HarmonyPatch(typeof(LobbyCharaSelectInfoScrollController), nameof(LobbyCharaSelectInfoScrollController.Init))] 14 | [HarmonyPatch(typeof(LobbyCharaSelectInfoScrollController1), 15 | nameof(LobbyCharaSelectInfoScrollController1.Init))] 16 | [SuppressMessage("ReSharper", "InconsistentNaming", Justification = "HarmonyPatch")] 17 | private static void LobbyCharaSelectInfoScrollControllerInitPrefix(List _lst) 18 | { 19 | try 20 | { 21 | TranslateFileInfos(_lst); 22 | } 23 | 24 | catch (Exception err) 25 | { 26 | Logger.LogException(err, nameof(LobbyCharaSelectInfoScrollControllerInitPrefix)); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKLike_TranslationHelper/KKLike_TranslationHelper.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 5f26c87f-b51a-4f58-8c56-36190b16fdd6 7 | 8 | 9 | TranslationHelperPlugin 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKLike_TranslationHelper/KKLike_TranslationHelper.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5f26c87f-b51a-4f58-8c56-36190b16fdd6 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKLike_TranslationHelper/MainGame/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using GeBoCommon.Utilities; 3 | 4 | namespace TranslationHelperPlugin.MainGame 5 | { 6 | internal partial class Configuration 7 | { 8 | public static event EventHandler PeriodChange; 9 | public static event EventHandler DayChange; 10 | public static event EventHandler StartH; 11 | public static event EventHandler EndH; 12 | 13 | internal static void OnPeriodChange(object sender, PeriodChangeEventArgs eventArgs) 14 | { 15 | PeriodChange?.SafeInvoke(sender, eventArgs); 16 | } 17 | 18 | internal static void OnDayChange(object sender, DayChangeEventArgs eventArgs) 19 | { 20 | DayChange?.SafeInvoke(sender, eventArgs); 21 | } 22 | 23 | public static void OnStartH(object sender, HSceneEventArgs eventArgs) 24 | { 25 | StartH?.SafeInvoke(sender, eventArgs); 26 | } 27 | 28 | public static void OnEndH(object sender, HSceneEventArgs eventArgs) 29 | { 30 | TranslationHelper.RegistrationManager.Cleanup(); 31 | EndH?.SafeInvoke(sender, eventArgs); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKLike_TranslationHelper/MainGame/Controller.cs: -------------------------------------------------------------------------------- 1 | using ActionGame; 2 | 3 | namespace TranslationHelperPlugin.MainGame 4 | { 5 | partial class Controller 6 | { 7 | protected override void OnPeriodChange(Cycle.Type period) 8 | { 9 | TranslationHelper.RegistrationManager.Cleanup(); 10 | Configuration.OnPeriodChange(this, new PeriodChangeEventArgs(period)); 11 | 12 | base.OnPeriodChange(period); 13 | } 14 | 15 | protected override void OnDayChange(Cycle.Week day) 16 | { 17 | TranslationHelper.RegistrationManager.Cleanup(true); 18 | Configuration.OnDayChange(this, new DayChangeEventArgs(day)); 19 | base.OnDayChange(day); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKLike_TranslationHelper/MainGame/EventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using ActionGame; 3 | using JetBrains.Annotations; 4 | using UnityEngine; 5 | 6 | namespace TranslationHelperPlugin.MainGame 7 | { 8 | public class PeriodChangeEventArgs : EventArgs 9 | { 10 | public PeriodChangeEventArgs(Cycle.Type period) 11 | { 12 | Period = period; 13 | } 14 | 15 | [PublicAPI] 16 | public Cycle.Type Period { get; } 17 | } 18 | 19 | public class DayChangeEventArgs : EventArgs 20 | { 21 | public DayChangeEventArgs(Cycle.Week day) 22 | { 23 | Day = day; 24 | } 25 | 26 | [PublicAPI] 27 | public Cycle.Week Day { get; } 28 | } 29 | 30 | public class HSceneEventArgs : EventArgs 31 | { 32 | public HSceneEventArgs(MonoBehaviour proc, HFlag hFlag, bool vr) 33 | { 34 | HProc = proc; 35 | Flag = hFlag; 36 | IsVR = vr; 37 | } 38 | 39 | [PublicAPI] 40 | public MonoBehaviour HProc { get; } 41 | 42 | [PublicAPI] 43 | public HFlag Flag { get; } 44 | 45 | [PublicAPI] 46 | public bool IsVR { get; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/Acceleration/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using HarmonyLib; 3 | using UnityEngine.Assertions; 4 | 5 | namespace TranslationHelperPlugin.Acceleration 6 | { 7 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 8 | internal static partial class Configuration 9 | { 10 | internal static void GameSpecificSetup(Harmony harmony) 11 | { 12 | Assert.IsNotNull(harmony); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/Acceleration/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace TranslationHelperPlugin.Acceleration 4 | { 5 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 6 | internal static partial class Hooks { } 7 | } 8 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/Chara/Configuration.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace TranslationHelperPlugin.Chara 4 | { 5 | internal static partial class Configuration 6 | { 7 | internal static void GameSpecificSetup(Harmony harmony) 8 | { 9 | Hooks.KKS_SetupHooks(harmony); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/Chara/Extensions.cs: -------------------------------------------------------------------------------- 1 | namespace TranslationHelperPlugin.Chara 2 | { 3 | public static partial class Extensions 4 | { 5 | private static readonly string[] FullNameNameTypes = { "lastname", "firstname" }; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/KKS.TranslationHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using System.Linq; 4 | using BepInEx; 5 | using BepInEx.Configuration; 6 | using GeBoCommon; 7 | using JetBrains.Annotations; 8 | 9 | namespace TranslationHelperPlugin 10 | { 11 | [BepInProcess(Constants.MainGameProcessName)] 12 | [BepInProcess(Constants.MainGameProcessNameVR)] 13 | [BepInProcess(Constants.StudioProcessName)] 14 | [BepInPlugin(GUID, PluginName, Version)] 15 | public partial class TranslationHelper : BaseUnityPlugin 16 | { 17 | public static ConfigEntry KKS_GivenNameFirst { get; private set; } 18 | 19 | 20 | // ReSharper disable once MemberCanBeMadeStatic.Global 21 | [SuppressMessage("Performance", "CA1822:Mark members as static")] 22 | internal void GameSpecificAwake() 23 | { 24 | SplitNamesBeforeTranslate = false; 25 | } 26 | 27 | internal void GameSpecificStart() 28 | { 29 | SplitNamesBeforeTranslate = false; 30 | 31 | KKS_GivenNameFirst = Config.Bind("Translate Card Name Options", "Show given name first", 32 | false, "Reverses the order of names to be Given Family instead of Family Given"); 33 | 34 | KKS_GivenNameFirst.SettingChanged += GivenNameFirstChanged; 35 | GivenNameFirstChanged(this, new SettingChangedEventArgs(KKS_GivenNameFirst)); 36 | } 37 | 38 | private void GivenNameFirstChanged(object sender, EventArgs e) 39 | { 40 | ShowGivenNameFirst = KKS_GivenNameFirst.Value; 41 | OnCardTranslationBehaviorChanged(e); 42 | } 43 | 44 | [UsedImplicitly] 45 | internal static string ProcessFullnameString(string input) 46 | { 47 | if (!ShowGivenNameFirst) return input; 48 | if (string.IsNullOrEmpty(input)) return input; 49 | var parts = input.Split(); 50 | return parts.Length != 2 ? input : string.Join(SpaceJoiner, parts.Reverse().ToArray()); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/MainGame/Controller.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace TranslationHelperPlugin.MainGame 4 | { 5 | public partial class Controller 6 | { 7 | protected override void OnStartH(MonoBehaviour proc, HFlag hFlag, bool vr) 8 | { 9 | Configuration.OnStartH(this, new HSceneEventArgs(proc, hFlag, vr)); 10 | base.OnStartH(proc, hFlag, vr); 11 | } 12 | 13 | protected override void OnEndH(MonoBehaviour proc, HFlag hFlag, bool vr) 14 | { 15 | Configuration.OnEndH(this, new HSceneEventArgs(proc, hFlag, vr)); 16 | base.OnEndH(proc, hFlag, vr); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/MainGame/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using GeBoCommon.Chara; 3 | using GeBoCommon.Utilities; 4 | using HarmonyLib; 5 | using SaveData; 6 | using static SaveData.WorldData; 7 | 8 | namespace TranslationHelperPlugin.MainGame 9 | { 10 | internal partial class Hooks 11 | { 12 | [HarmonyPrefix] 13 | [HarmonyPatch(typeof(WorldData), nameof(FindCallFileData), typeof(CharaData))] 14 | private static void WorldDataFindCallFileDataPrefix(CharaData charaData) 15 | { 16 | try 17 | { 18 | if (charaData == null) return; 19 | Configuration.StartCoroutine(Configuration.TranslateCharaDataNames(charaData)); 20 | } 21 | catch (Exception err) 22 | { 23 | Logger.LogException(err, nameof(WorldDataFindCallFileDataPrefix)); 24 | } 25 | } 26 | 27 | [HarmonyPostfix] 28 | [HarmonyPatch(typeof(WorldData), nameof(FindCallFileData), typeof(int), typeof(int))] 29 | private static void WorldDataFindCallFileDataPostfix(CallFileData __result) 30 | { 31 | try 32 | { 33 | if (__result == null) return; 34 | if (TranslationHelper.TryTranslateName(new NameScope(CharacterSex.Male), __result.name, 35 | out var translatedName)) 36 | { 37 | __result.name = translatedName; 38 | } 39 | } 40 | catch (Exception err) 41 | { 42 | Logger.LogException(err, nameof(WorldDataFindCallFileDataPostfix)); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/Maker/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Diagnostics.CodeAnalysis; 4 | using ChaCustom; 5 | using HarmonyLib; 6 | using KKAPI.Maker; 7 | using TranslationHelperPlugin.Chara; 8 | using UnityEngine.Assertions; 9 | 10 | namespace TranslationHelperPlugin.Maker 11 | { 12 | internal static partial class Configuration 13 | { 14 | internal static void GameSpecificSetup(Harmony harmony) 15 | { 16 | Assert.IsNotNull(harmony); 17 | } 18 | 19 | private static IEnumerable> GetNameInputFieldInfos() 20 | { 21 | // ReSharper disable once StringLiteralTypo - inherited 22 | const string top = "CharactorTop"; 23 | yield return new KeyValuePair("firstname", new[] { top, "InputName", "InpFirstName" }); 24 | yield return new KeyValuePair("lastname", new[] { top, "InputName", "InpLastName" }); 25 | yield return new KeyValuePair("nickname", new[] { top, "InputNickName", "InpNickName" }); 26 | } 27 | 28 | [SuppressMessage("ReSharper", "ParameterOnlyUsedForPreconditionCheck.Local")] 29 | private static IEnumerator GameSpecificUpdateUICoroutine(Controller controller) 30 | { 31 | Assert.IsNotNull(controller); 32 | var makerBase = MakerAPI.GetMakerBase(); 33 | if (makerBase == null) yield break; 34 | 35 | makerBase.GetComponentInChildren().SafeProcObject(o => o.UpdateCustomUI()); 36 | makerBase.GetComponentInChildren().SafeProcObject(o => o.UpdateCustomUI()); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using GeBoCommon; 4 | using TranslationHelperPlugin; 5 | using static TranslationHelperPlugin.TranslationHelper; 6 | 7 | // Setting ComVisible to false makes the types in this assembly not visible 8 | // to COM components. If you need to access a type in this assembly from 9 | // COM, set the ComVisible attribute to true on that type. 10 | [assembly: ComVisible(false)] 11 | 12 | // The following GUID is for the ID of the typelib if this project is exposed to COM 13 | [assembly: Guid("49542496-4956-48f9-91d7-1b6e86337b8a")] 14 | 15 | // Version information for an assembly consists of the following four values: 16 | // 17 | // Major Version 18 | // Minor Version 19 | // Build Number 20 | // Revision 21 | // 22 | // You can specify all the values or you can default the Build and Revision Numbers 23 | // by using the '*' as shown below: 24 | // [assembly: AssemblyVersion("1.0.*")] 25 | [assembly: AssemblyVersion(Version)] 26 | [assembly: AssemblyFileVersion(Version)] 27 | [assembly: AssemblyDescription(PluginName + " for " + Constants.GameName)] 28 | [assembly: AssemblyTitle(Constants.Prefix + "_" + nameof(TranslationHelper))] 29 | [assembly: AssemblyProduct(Constants.Prefix + "_" + nameof(TranslationHelper))] 30 | [assembly: AssemblyCompany(Constants.RepoUrl)] 31 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/Studio/Configuration.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine.Assertions; 3 | 4 | namespace TranslationHelperPlugin.Studio 5 | { 6 | internal static partial class Configuration 7 | { 8 | internal static void GameSpecificSetup(Harmony harmony) 9 | { 10 | Assert.IsNotNull(harmony); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/Utils/CustomFileInfoWrapper.cs: -------------------------------------------------------------------------------- 1 | using ChaCustom; 2 | using GeBoCommon.Chara; 3 | 4 | namespace TranslationHelperPlugin.Utils 5 | { 6 | internal class CustomFileInfoWrapper : ICharaFileInfo 7 | { 8 | private readonly CustomFileInfo _fileInfo; 9 | 10 | public CustomFileInfoWrapper(CustomFileInfo customFileInfo) 11 | { 12 | _fileInfo = customFileInfo; 13 | } 14 | 15 | public int Index => _fileInfo.index; 16 | 17 | public string Name 18 | { 19 | get => _fileInfo.name; 20 | set => _fileInfo.name = value; 21 | } 22 | 23 | public string FullPath => _fileInfo.FullPath; 24 | public string Club => _fileInfo.club; 25 | public string Personality => _fileInfo.personality; 26 | 27 | public CharacterSex Sex => this.GuessSex(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/Utils/DummyFileInfoWrapper.cs: -------------------------------------------------------------------------------- 1 | using GeBoCommon.Chara; 2 | 3 | namespace TranslationHelperPlugin.Utils 4 | { 5 | internal class DummyFileInfoWrapper : ICharaFileInfo 6 | { 7 | internal DummyFileInfoWrapper(int index, string name, string club, string personality, string fullPath) 8 | { 9 | Index = index; 10 | Name = name; 11 | FullPath = fullPath; 12 | Club = club; 13 | Personality = personality; 14 | } 15 | 16 | public int Index { get; } 17 | public string Name { get; set; } 18 | public string FullPath { get; } 19 | public string Club { get; } 20 | public string Personality { get; } 21 | public CharacterSex Sex => this.GuessSex(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/TranslationHelper/KKS_TranslationHelper/Utils/ICharaFileInfo.cs: -------------------------------------------------------------------------------- 1 | namespace TranslationHelperPlugin.Utils 2 | { 3 | public partial interface ICharaFileInfo 4 | { 5 | string Club { get; } 6 | string Personality { get; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/Acceleration/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using HarmonyLib; 3 | using UnityEngine.Assertions; 4 | 5 | namespace TranslationHelperPlugin.Acceleration 6 | { 7 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 8 | internal static partial class Configuration 9 | { 10 | internal static void GameSpecificSetup(Harmony harmony) 11 | { 12 | Assert.IsNotNull(harmony); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/Acceleration/Hooks.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | 3 | namespace TranslationHelperPlugin.Acceleration 4 | { 5 | [SuppressMessage("ReSharper", "PartialTypeWithSinglePart")] 6 | internal static partial class Hooks { } 7 | } 8 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/Chara/Configuration.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace TranslationHelperPlugin.Chara 4 | { 5 | internal static partial class Configuration 6 | { 7 | internal static void GameSpecificSetup(Harmony harmony) 8 | { 9 | Hooks.KK_SetupHooks(harmony); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/Chara/Extensions.cs: -------------------------------------------------------------------------------- 1 | namespace TranslationHelperPlugin.Chara 2 | { 3 | public static partial class Extensions 4 | { 5 | private static readonly string[] FullNameNameTypes = { "lastname", "firstname" }; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/Chara/Hooks.cs: -------------------------------------------------------------------------------- 1 | using GeBoCommon.Utilities; 2 | using HarmonyLib; 3 | 4 | namespace TranslationHelperPlugin.Chara 5 | { 6 | internal partial class Hooks 7 | { 8 | internal static void KK_SetupHooks(Harmony harmony) 9 | { 10 | var propGetter = AccessTools.PropertyGetter(typeof(ChaFileParameter), nameof(ChaFileParameter.fullname)); 11 | if (propGetter == null) return; 12 | var prefix = AccessTools.Method(typeof(Hooks), nameof(ChaFileParameterFullnamePrefix)); 13 | if (prefix == null) return; 14 | harmony.Patch(propGetter, new HarmonyMethod(prefix)); 15 | } 16 | 17 | private static bool ChaFileParameterFullnamePrefix(ChaFileParameter __instance, ref string __result) 18 | { 19 | if (!TranslationHelper.ShowGivenNameFirst) return true; 20 | __result = StringUtils.JoinStrings(TranslationHelper.SpaceJoiner, __instance.firstname, 21 | __instance.lastname); 22 | return false; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/MainGame/Configuration.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using UnityEngine.Assertions; 3 | 4 | namespace TranslationHelperPlugin.MainGame 5 | { 6 | internal static partial class Configuration 7 | { 8 | internal static void GameSpecificSetup(Harmony harmony) 9 | { 10 | Assert.IsNotNull(harmony); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/MainGame/Controller.cs: -------------------------------------------------------------------------------- 1 | namespace TranslationHelperPlugin.MainGame 2 | { 3 | public partial class Controller 4 | { 5 | protected override void OnStartH(BaseLoader proc, HFlag hFlag, bool vr) 6 | { 7 | Configuration.OnStartH(this, new HSceneEventArgs(proc, hFlag, vr)); 8 | base.OnStartH(proc, hFlag, vr); 9 | } 10 | 11 | protected override void OnEndH(BaseLoader proc, HFlag hFlag, bool vr) 12 | { 13 | Configuration.OnEndH(this, new HSceneEventArgs(proc, hFlag, vr)); 14 | base.OnEndH(proc, hFlag, vr); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/Maker/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Diagnostics.CodeAnalysis; 4 | using ChaCustom; 5 | using HarmonyLib; 6 | using JetBrains.Annotations; 7 | using KKAPI.Maker; 8 | using TranslationHelperPlugin.Chara; 9 | using UnityEngine.Assertions; 10 | 11 | namespace TranslationHelperPlugin.Maker 12 | { 13 | internal static partial class Configuration 14 | { 15 | internal static void GameSpecificSetup(Harmony harmony) 16 | { 17 | Assert.IsNotNull(harmony); 18 | } 19 | 20 | private static IEnumerable> GetNameInputFieldInfos() 21 | { 22 | // ReSharper disable once StringLiteralTypo - inherited 23 | const string top = "CharactorTop"; 24 | yield return new KeyValuePair("firstname", new[] { top, "InputName", "InpFirstName" }); 25 | yield return new KeyValuePair("lastname", new[] { top, "InputName", "InpLastName" }); 26 | yield return new KeyValuePair("nickname", new[] { top, "InputNickName", "InpNickName" }); 27 | } 28 | 29 | [SuppressMessage("ReSharper", "ParameterOnlyUsedForPreconditionCheck.Local")] 30 | private static IEnumerator GameSpecificUpdateUICoroutine([NotNull] Controller controller) 31 | { 32 | Assert.IsNotNull(controller); 33 | var makerBase = MakerAPI.GetMakerBase(); 34 | if (makerBase == null) yield break; 35 | 36 | makerBase.GetComponentInChildren().SafeProcObject(o => o.UpdateCustomUI()); 37 | makerBase.GetComponentInChildren().SafeProcObject(o => o.UpdateCustomUI()); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | using GeBoCommon; 4 | using TranslationHelperPlugin; 5 | using static TranslationHelperPlugin.TranslationHelper; 6 | 7 | // Setting ComVisible to false makes the types in this assembly not visible 8 | // to COM components. If you need to access a type in this assembly from 9 | // COM, set the ComVisible attribute to true on that type. 10 | [assembly: ComVisible(false)] 11 | 12 | // The following GUID is for the ID of the typelib if this project is exposed to COM 13 | [assembly: Guid("6b60025d-20de-4df7-aeb2-be76490a7386")] 14 | 15 | // Version information for an assembly consists of the following four values: 16 | // 17 | // Major Version 18 | // Minor Version 19 | // Build Number 20 | // Revision 21 | // 22 | // You can specify all the values or you can default the Build and Revision Numbers 23 | // by using the '*' as shown below: 24 | // [assembly: AssemblyVersion("1.0.*")] 25 | [assembly: AssemblyVersion(Version)] 26 | [assembly: AssemblyFileVersion(Version)] 27 | [assembly: AssemblyDescription(PluginName + " for " + Constants.GameName)] 28 | [assembly: AssemblyTitle(Constants.Prefix + "_" + nameof(TranslationHelper))] 29 | [assembly: AssemblyProduct(Constants.Prefix + "_" + nameof(TranslationHelper))] 30 | [assembly: AssemblyCompany(Constants.RepoUrl)] 31 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/Studio/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using HarmonyLib; 3 | using Studio; 4 | using UnityEngine.Assertions; 5 | 6 | namespace TranslationHelperPlugin.Studio 7 | { 8 | internal static partial class Configuration 9 | { 10 | internal static void GameSpecificSetup(Harmony harmony) 11 | { 12 | Assert.IsNotNull(harmony); 13 | AlternateStudioCharaLoaderTranslators.Add(TryApplyLoadCharaFileTranslatedMap); 14 | TranslationHelper.CardTranslationBehaviorChanged += CleanupHandler; 15 | } 16 | 17 | private static void CleanupHandler(object sender, EventArgs e) 18 | { 19 | Hooks.ResetTranslatingCallbacks(); 20 | } 21 | 22 | 23 | private static bool TryApplyLoadCharaFileTranslatedMap(NameScope sexOnlyScope, CharaFileInfo charaFileInfo, 24 | string origName, bool fastOnly) 25 | { 26 | if (!Translation.Configuration.LoadCharaFileTranslatedMap[sexOnlyScope] 27 | .TryGetValue(origName, out var translatedName) || 28 | string.IsNullOrEmpty(translatedName)) 29 | { 30 | return false; 31 | } 32 | 33 | charaFileInfo.node.text = charaFileInfo.name = translatedName; 34 | return true; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/Utils/CustomFileInfoWrapper.cs: -------------------------------------------------------------------------------- 1 | using ChaCustom; 2 | using GeBoCommon.Chara; 3 | 4 | namespace TranslationHelperPlugin.Utils 5 | { 6 | internal class CustomFileInfoWrapper : CharaFileInfoWrapper 7 | { 8 | public CustomFileInfoWrapper(CustomFileInfo customFileInfo) : base(customFileInfo) { } 9 | 10 | // used in maker, so get sex that way 11 | public override CharacterSex Sex => this.GuessSex(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/Utils/DummyFileInfoWrapper.cs: -------------------------------------------------------------------------------- 1 | using GeBoCommon.Chara; 2 | 3 | namespace TranslationHelperPlugin.Utils 4 | { 5 | internal class DummyFileInfoWrapper : ICharaFileInfo 6 | { 7 | internal DummyFileInfoWrapper(int index, string name, string club, string personality, string fullPath) 8 | { 9 | Index = index; 10 | Name = name; 11 | FullPath = fullPath; 12 | Club = club; 13 | Personality = personality; 14 | } 15 | 16 | public int Index { get; } 17 | public string Name { get; set; } 18 | public string FullPath { get; } 19 | public string Club { get; } 20 | public string Personality { get; } 21 | public CharacterSex Sex => this.GuessSex(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/TranslationHelper/KK_TranslationHelper/Utils/ICharaFileInfo.cs: -------------------------------------------------------------------------------- 1 | namespace TranslationHelperPlugin.Utils 2 | { 3 | public partial interface ICharaFileInfo 4 | { 5 | string Club { get; } 6 | string Personality { get; } 7 | } 8 | } 9 | --------------------------------------------------------------------------------