mirror of
https://github.com/TheJordanDev/PEAK-JordanMod.git
synced 2026-10-17 08:05:25 +02:00
0.1.12 | Added: Open Passport keybind
Also removes a leftover debug keybind on the BingBong module that was bound to P and would have fired alongside the new passport keybind. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,9 @@ public static class ConfigHandler
|
||||
// Better Airport
|
||||
public static ConfigEntry<float> ConveyorSpeedModifier { get; private set; } = null!;
|
||||
|
||||
// Open Passport settings
|
||||
public static ConfigEntry<KeyCode> OpenPassport { get; private set; } = null!;
|
||||
|
||||
// Stashed Bugle settings
|
||||
public static ConfigEntry<KeyCode> ToggleBugle { get; private set; } = null!;
|
||||
|
||||
@@ -49,6 +52,14 @@ public static class ConfigHandler
|
||||
)
|
||||
);
|
||||
|
||||
// Open Passport settings
|
||||
OpenPassport = Config.Bind(
|
||||
"Key Bindings",
|
||||
"OpenPassport",
|
||||
KeyCode.P,
|
||||
new ConfigDescription("Open Passport UI")
|
||||
);
|
||||
|
||||
// Stashed Bugle settings
|
||||
ToggleBugle = Config.Bind(
|
||||
"Control",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<!-- This is the display name of your mod. Example: BepInEx Template -->
|
||||
<AssemblyTitle>JordanMod</AssemblyTitle>
|
||||
<!-- This is the version number of your mod. -->
|
||||
<Version>0.1.11</Version>
|
||||
<Version>0.1.12</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
28
src/JordanMod/modules/open_passport/OpenPassportModule.cs
Normal file
28
src/JordanMod/modules/open_passport/OpenPassportModule.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace JordanMod.Modules.OpenPassport;
|
||||
|
||||
[Module(Enabled = true)]
|
||||
class OpenPassportModule : Module
|
||||
{
|
||||
public override string ModuleName => "Open Passport Module";
|
||||
|
||||
public override Type[] GetPatches() { return []; }
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
if (!Input.GetKeyDown(ConfigHandler.OpenPassport.Value)) return;
|
||||
|
||||
// PassportManager.instance is a plain static that survives a scene unload, so it can
|
||||
// be a destroyed object here; the Unity == operator is what catches that. Its
|
||||
// Initialize() also reads Character.localCharacter.characterName, so don't open it
|
||||
// before we have a character.
|
||||
PassportManager passportManager = PassportManager.instance;
|
||||
if (passportManager == null) return;
|
||||
if (Character.localCharacter == null) return;
|
||||
if (passportManager.isOpen) return;
|
||||
|
||||
passportManager.ToggleOpen();
|
||||
}
|
||||
}
|
||||
@@ -27,17 +27,6 @@ class ReplaceBingBongModule : Module
|
||||
AudioSyncWorker.OnAudioLoadComplete += OnAudioLoadComplete;
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (Input.GetKeyDown(KeyCode.P))
|
||||
{
|
||||
Helper.FindItemByName("BingBong_Prop Variant", out Item? item);
|
||||
if (item == null) return;
|
||||
Debug.Log($"Found item: {item.name} in scene {item.gameObject.scene.name}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnAudioLoadComplete()
|
||||
{
|
||||
if (!HasReplacedSounds) return;
|
||||
|
||||
Reference in New Issue
Block a user