Skip to content

Commit

Permalink
TitleShortcuts - Add HoneySelect2 version
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Nov 9, 2022
1 parent 9665246 commit 50fe2a6
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 0 deletions.
10 changes: 10 additions & 0 deletions KeelPlugins.sln
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FreeHDefaults.KoikatuSunshi
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "FreeHDefaults.Core", "src\FreeHDefaults.Core\FreeHDefaults.Core.shproj", "{D77A4720-B234-4A59-B7EF-7F9ABEA81CD3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TitleShortcuts.HoneySelect2", "src\TitleShortcuts.HoneySelect2\TitleShortcuts.HoneySelect2.csproj", "{CA3C684F-A778-4C76-8CA2-DFB93A8CAC13}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -391,6 +393,10 @@ Global
{A7AFC683-C17F-4B97-8127-122BAD10FBE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7AFC683-C17F-4B97-8127-122BAD10FBE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7AFC683-C17F-4B97-8127-122BAD10FBE8}.Release|Any CPU.Build.0 = Release|Any CPU
{CA3C684F-A778-4C76-8CA2-DFB93A8CAC13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CA3C684F-A778-4C76-8CA2-DFB93A8CAC13}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CA3C684F-A778-4C76-8CA2-DFB93A8CAC13}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CA3C684F-A778-4C76-8CA2-DFB93A8CAC13}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -487,6 +493,7 @@ Global
{8C76020F-A387-4306-8FD3-AA4E7660C8C8} = {21652626-F032-4986-B258-C36B4C9115E7}
{A7AFC683-C17F-4B97-8127-122BAD10FBE8} = {A541BB96-39B7-44C7-98A1-C934EFBD52AE}
{D77A4720-B234-4A59-B7EF-7F9ABEA81CD3} = {A541BB96-39B7-44C7-98A1-C934EFBD52AE}
{CA3C684F-A778-4C76-8CA2-DFB93A8CAC13} = {E462D3D8-0715-45C9-869C-F1FA8CD2F5CD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CECC9C6B-8041-49A1-B7FD-DC89264B7393}
Expand Down Expand Up @@ -630,6 +637,9 @@ Global
src\Common.Harmony\Common.Harmony.projitems*{ca3a790c-911e-441b-b9c6-4d45dcb9882e}*SharedItemsImports = 5
src\Common.Koikatu\Common.Koikatu.projitems*{ca3a790c-911e-441b-b9c6-4d45dcb9882e}*SharedItemsImports = 5
src\TitleShortcuts.Core\TitleShortcuts.Core.projitems*{ca3a790c-911e-441b-b9c6-4d45dcb9882e}*SharedItemsImports = 5
src\Common.Core\Common.Core.projitems*{ca3c684f-a778-4c76-8ca2-dfb93a8cac13}*SharedItemsImports = 5
src\Common.HoneySelect2\Common.HoneySelect2.projitems*{ca3c684f-a778-4c76-8ca2-dfb93a8cac13}*SharedItemsImports = 5
src\TitleShortcuts.Core\TitleShortcuts.Core.projitems*{ca3c684f-a778-4c76-8ca2-dfb93a8cac13}*SharedItemsImports = 5
src\Common.Core\Common.Core.projitems*{cf849c91-b667-4196-b162-1635163f0476}*SharedItemsImports = 4
src\Common.KoikatsuSunshine\Common.KoikatsuSunshine.projitems*{cf849c91-b667-4196-b162-1635163f0476}*SharedItemsImports = 4
src\StudioAddonLite.Core\StudioAddonLite.Core.projitems*{cf849c91-b667-4196-b162-1635163f0476}*SharedItemsImports = 4
Expand Down
1 change: 1 addition & 0 deletions src/Common.HoneySelect2/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
internal static class Constants
{
public const string MainGameProcessName = "HoneySelect2";
public const string VRProcessName = "HoneySelect2VR";
public const string StudioProcessName = "StudioNEOV2";
}
}
16 changes: 16 additions & 0 deletions src/TitleShortcuts.HoneySelect2/TitleShortcuts.HoneySelect2.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\BuildSettings.Common.props" />
<Import Project="..\BuildSettings.HoneySelect2.props" />
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.4.4" />
<PackageReference Include="IllusionLibs.HoneySelect2.Assembly-CSharp" Version="2020.5.29.4" />
<PackageReference Include="IllusionLibs.HoneySelect2.Assembly-CSharp-firstpass" Version="2020.5.29.4" />
<PackageReference Include="IllusionLibs.HoneySelect2.IL" Version="2020.5.29.4" />
<PackageReference Include="IllusionLibs.HoneySelect2.UnityEngine.CoreModule" Version="2018.4.11.4" />
<PackageReference Include="IllusionLibs.HoneySelect2.UnityEngine.UI" Version="2018.4.11.4" />
<PackageReference Include="IllusionLibs.HoneySelect2.UnityEngine.UIModule" Version="2018.4.11.4" />
</ItemGroup>
<Import Project="..\TitleShortcuts.Core\TitleShortcuts.Core.projitems" Label="Shared" />
<Import Project="..\Common.Core\Common.Core.projitems" Label="Shared" />
<Import Project="..\Common.HoneySelect2\Common.HoneySelect2.projitems" Label="Shared" />
</Project>
80 changes: 80 additions & 0 deletions src/TitleShortcuts.HoneySelect2/TitleShortcuts.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
using AIProject;
using BepInEx;
using BepInEx.Configuration;
using KeelPlugins.HoneySelect2;
using System.Collections;
using HS2;
using TitleShortcuts.Core;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;

[assembly: System.Reflection.AssemblyFileVersion(TitleShortcuts.HoneySelect2.TitleShortcuts.Version)]

namespace TitleShortcuts.HoneySelect2
{
[BepInProcess(Constants.MainGameProcessName)]
[BepInPlugin(GUID, PluginName, Version)]
public class TitleShortcuts : TitleShortcutsCore
{
public const string Version = "1.3.0." + BuildNumber.Version;

private ConfigEntry<KeyboardShortcut> StartFemaleMaker { get; set; }
private ConfigEntry<KeyboardShortcut> StartMaleMaker { get; set; }
private ConfigEntry<KeyboardShortcut> StartUploader { get; set; }
private ConfigEntry<KeyboardShortcut> StartDownloader { get; set; }
private ConfigEntry<KeyboardShortcut> StartGame { get; set; }

private TitleScene titleScene;

protected override void Awake()
{
base.Awake();

StartFemaleMaker = Config.Bind(SECTION_HOTKEYS, "Open female maker", new KeyboardShortcut(KeyCode.F));
StartMaleMaker = Config.Bind(SECTION_HOTKEYS, "Open male maker", new KeyboardShortcut(KeyCode.M));
StartUploader = Config.Bind(SECTION_HOTKEYS, "Open uploader", new KeyboardShortcut(KeyCode.U));
StartDownloader = Config.Bind(SECTION_HOTKEYS, "Open downloader", new KeyboardShortcut(KeyCode.D));
StartGame = Config.Bind(SECTION_HOTKEYS, "Open main game", new KeyboardShortcut(KeyCode.G));

SceneManager.sceneLoaded += StartInput;
}

private void StartInput(Scene scene, LoadSceneMode mode)
{
StopAllCoroutines();

titleScene = FindObjectOfType<TitleScene>();

if (titleScene) StartCoroutine(InputCheck());
}

private IEnumerator InputCheck()
{
while (titleScene)
{
if (!Manager.Scene.IsNowLoadingFade)
{
if (StartFemaleMaker.Value.IsPressed()) StartMode(titleScene.OnMakeFemale, "Starting female maker");
else if (StartMaleMaker.Value.IsPressed()) StartMode(titleScene.OnMakeMale, "Starting male maker");
else if (StartUploader.Value.IsPressed()) StartMode(titleScene.OnUpload, "Starting uploader");
else if (StartDownloader.Value.IsPressed()) StartMode(titleScene.OnDownload, "Starting downloader");
else if (StartGame.Value.IsPressed()) StartMode(titleScene.OnPlay, "Starting main game");
}

yield return null;
}

void StartMode(UnityAction action, string msg)
{
var configWindow = FindObjectOfType<Config.ConfigWindow>();
if (!configWindow || !configWindow.active)
{
Log.Message(msg);
action();
titleScene = null;
}
}
}
}
}

0 comments on commit 50fe2a6

Please sign in to comment.