Skip to content

Commit

Permalink
feat: door default begin
Browse files Browse the repository at this point in the history
  • Loading branch information
Clazex committed Oct 27, 2021
1 parent 4029aa9 commit ef9506f
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 3 deletions.
2 changes: 1 addition & 1 deletion GodSeekerPlus/GodSeekerPlus.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Reflection;
using Modding;
using GodSeekerPlus.Util;
using Modding;

namespace GodSeekerPlus {
public sealed partial class GodSeekerPlus : Mod {
Expand Down
6 changes: 6 additions & 0 deletions GodSeekerPlus/GodSeekerPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,18 @@
<Reference Include="UnityEngine">
<HintPath>$(HKRefs)/UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>$(HKRefs)/UnityEngine.AnimationModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>$(HKRefs)/UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>$(HKRefs)/UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>$(HKRefs)/UnityEngine.UIModule.dll</HintPath>
</Reference>
<Reference Include="PlayMaker">
<HintPath>$(HKRefs)/PlayMaker.dll</HintPath>
</Reference>
Expand Down
1 change: 1 addition & 0 deletions GodSeekerPlus/Lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"GodSeekerPlus": "God Seeker +",
"RequireRestart": "Requires a restart to take effect.",
"Modules/CarefreeMelodyFix": "Carefree Melody Fix",
"Modules/DoorDefaultBegin": "Door Default Begin",
"Modules/FastDreamWarp": "Fast Dream Warp",
"Modules/FastSuperDash": "Fast Super Dash",
"Modules/FrameRateLimit": "Frame Rate Limit",
Expand Down
1 change: 1 addition & 0 deletions GodSeekerPlus/Lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"GodSeekerPlus": "寻神者+",
"RequireRestart": "需重启以生效。",
"Modules/CarefreeMelodyFix": "无忧旋律修复",
"Modules/DoorDefaultBegin": "门默认开始",
"Modules/FastDreamWarp": "快速梦门传送",
"Modules/FastSuperDash": "快速超级冲刺",
"Modules/FrameRateLimit": "帧率限制",
Expand Down
45 changes: 45 additions & 0 deletions GodSeekerPlus/Modules/DoorDefaultBegin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System.Collections;
using GodSeekerPlus.Util;
using Modding;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

namespace GodSeekerPlus.Modules {
[Module(toggleable = true, defaultEnabled = true)]
internal sealed class DoorDefaultBegin : Module {
private protected override void Load() => On.BossDoorChallengeUI.ShowSequence += OverrideOrig;

private protected override void Unload() => On.BossDoorChallengeUI.ShowSequence -= OverrideOrig;

private static IEnumerator OverrideOrig(On.BossDoorChallengeUI.orig_ShowSequence _, BossDoorChallengeUI self) {
CanvasGroup group = ReflectionHelper.GetField<BossDoorChallengeUI, CanvasGroup>(self, "group");
Animator animator = ReflectionHelper.GetField<BossDoorChallengeUI, Animator>(self, "animator");

group.interactable = false;
EventSystem.current.SetSelectedGameObject(null);
yield return null;

if (animator) {
animator.Play("Open");
yield return null;
yield return new WaitForSeconds(animator.GetCurrentAnimatorStateInfo(0).length);
}

group.interactable = true;

// if (self.buttons.Length != 0) {
// EventSystem.current.SetSelectedGameObject(self.buttons[0].gameObject); // <-- Removed
// }

group
.GetComponentsInChildren<MenuButton>()
.Filter(btn => btn.name == "BeginButton")
.ForEach(btn => EventSystem.current.SetSelectedGameObject(btn.gameObject));

InputHandler.Instance.StartUIInput();

yield break;
}
}
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ Compatible with `Hollow Knight` 1.5.
## Features

- **Carefree Melody Fix**\*: Remove the Grimmchild mistakenly spawned when equipping Carefree Melody not acquired in normal means. The effect is permanent.
- **Door Default Begin**\*: Default selecting the Begin button when opening Pantheon Door UI.
- **Fast Dream Warping**: Remove dream warping charge time when in Godhome boss fight rooms. This decrease the total warping time from 2.25s to 0.25s.
- **Fast Super Dash**: Buff Super Dash speed in Hall of Gods.
- **Frame Rate Limit**\*: Create a lag in every in-game frame.
- **Halve Damage**\*: Halve all the damage taken.
- **Memorize Bindings**\*: Memorize the Bindings selected last time, like difficulties in the Hall of Gods.
- **Memorize Bindings**\*: Memorize the Bindings selected last time, like difficulties in the Hall of Gods. Recommend using with Door Default Begin.
- **Unlock Eternal Ordeal**\*: Auto unlock the Eternal Ordeal.
- **Unlock Radiance**\*: Auto unlock the Radiance in Hall of Gods when in God Seeker mode.

Expand All @@ -22,6 +23,7 @@ Features marked with an `*` can be toggled in-game.

- `features` (`Object`): Whether to enable specified features.
+ `CarefreeMelodyFix` (`Boolean`): Whether to enable the Carefree Melody Fix feature. Defaults to `true`.
+ `DoorDefaultBegin` (`Boolean`): Whether to enable the Door Default Begin feature. Defaults to `true`.
+ `FastDreamWarp` (`Boolean`): Whether to enable the Fast Dream Warping feature. Defaults to `true`.
+ `FastSuperDash` (`Boolean`): Whether to enable the Fast Super Dash feature. Defaults to `true`.
+ `FrameRateLimit` (`Boolean`): Whether to enable the Frame Rate Limit feature. Defaults to `false`.
Expand Down
4 changes: 3 additions & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
## 功能

- **无忧旋律修复**\*:移除在装备非正常途径获得的无忧旋律时错误生成的格林之子。效果是永久的。
- **门默认开始**\*:打开万神殿门界面时默认选中开始按钮。
- **快速梦门传送**:当在神居 Boss 战房间中时,移除梦之门传送充能时间。这将总传送时间从 2.25 秒减少到 0.25 秒。
- **快速超级冲刺**:提升在诸神堂中的超级冲刺速度。
- **帧率限制**\*:在游戏内的每帧添加卡顿。
- **伤害减半**\*: 将受到的所有伤害减半。
- **记住束缚**\*:记住上次选择的束缚,效果与诸神堂中的难度选择一样。
- **记住束缚**\*:记住上次选择的束缚,效果与诸神堂中的难度选择一样。建议与门默认开始一起使用。
- **解锁无尽折磨**\*: 自动解锁无尽折磨。
- **解锁辐光**\*: 在寻神者模式中,自动在诸神堂解锁辐光。

Expand All @@ -22,6 +23,7 @@

- `features` (`Object`): 是否启用指定的功能。
+ `CarefreeMelodyFix` (`Boolean`):是否启用 `无忧旋律修复` 功能。默认为 `true`
+ `DoorDefaultBegin` (`Boolean`):是否启用 `门默认开始` 功能。默认为 `true`
+ `FastDreamWarp` (`Boolean`):是否启用 `快速梦门传送` 功能。默认为 `true`
+ `FastSuperDash` (`Boolean`):是否启用 `快速超级冲刺` 功能。默认为 `true`
+ `FrameRateLimit` (`Boolean`):是否启用 `帧率限制` 功能。默认为 `false`
Expand Down

0 comments on commit ef9506f

Please sign in to comment.